2
29
Fork
You've already forked dam
12

Handle -Wincompatible-pointer-types #45

Open
opened 2025年12月23日 02:20:13 +01:00 by sleen · 0 comments

I recently packaged this for Alpine Linux, and noticed that, with our default build configuration, there are quite a few -Wincompatible-pointer-types errors—essentially everywhere that the noop function pointer is used. This doesn't happen with CC=c99, the default for .POSIX:, but does with -std=c23, which is the default standard for recent versions of GCC (though not yet Clang):

dam.c:500:24: error: initialization of 'void (*)(void *, struct wl_output *, const char *)' from incompatible pointer type 'void (*)(void)' [-Wincompatible-pointer-types]
 500 | .description = noop,
 | ^~~~
dam.c:500:24: note: (near initialization for 'output_listener.description')

(Trimmed for brevity, full log available here.)

In my case, I just added -Wno-incompatible-pointer-types to CFLAGS, but specifying an earlier standard in the Makefile or manually casting each assignment of noop would also work.

I recently packaged this for Alpine Linux, and noticed that, with our default build configuration, there are quite a few `-Wincompatible-pointer-types` errors—essentially everywhere that the `noop` function pointer is used. This doesn't happen with `CC=c99`, the default for `.POSIX:`, but does with `-std=c23`, which is the default standard for recent versions of GCC (though not yet Clang): > ``` > dam.c:500:24: error: initialization of 'void (*)(void *, struct wl_output *, const char *)' from incompatible pointer type 'void (*)(void)' [-Wincompatible-pointer-types] > 500 | .description = noop, > | ^~~~ > dam.c:500:24: note: (near initialization for 'output_listener.description') > ``` (Trimmed for brevity, full log available [here](https://paste.sr.ht/blob/4afb6d572567023db66a79a62b3b825ad6c1215b).) In my case, I just added `-Wno-incompatible-pointer-types` to `CFLAGS`, but specifying an earlier standard in the Makefile or manually casting each assignment of `noop` would also work.
Sign in to join this conversation.
No Branch/Tag specified
master
sewn
hide_vacant_tags
titlew
splitstatus
occcol
hide-vacant-tags
No results found.
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sewn/dam#45
Reference in a new issue
sewn/dam
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?