Skip to content

Fix C23 issues#25

Merged
artizirk merged 1 commit intoartizirk:masterfrom
ceamac:fix/C23
Jul 25, 2025
Merged

Fix C23 issues#25
artizirk merged 1 commit intoartizirk:masterfrom
ceamac:fix/C23

Conversation

@ceamac
Copy link
Copy Markdown

@ceamac ceamac commented Dec 28, 2024

gcc 15 is more strict and compiles C by default with C23. noop is used as a default null initializer, but now it must have the correct type, so add a cast.

See also: https://bugs.gentoo.org/946954

gcc 15 is more strict and compiles C by default with C23.  `noop` is
used as a default null initializer, but now it must have the correct
type, so add a cast.

See also: https://bugs.gentoo.org/946954
@soreau
Copy link
Copy Markdown

soreau commented May 1, 2025

Hm, I figured this was caused by latest wayland but apparently it's C23? In any event, #27 might be a cleaner solution.

@NamorNiradnug
Copy link
Copy Markdown

NamorNiradnug commented May 1, 2025

I'm not sure but AFAIK calling a function with wrong number of arguments is UB, i.e. this noop hack is not a valid way of doing the thing.

@bodograumann
Copy link
Copy Markdown

At least it fixes the issue for me. So thanks <3

Used this in the PKBUILD file:

url='https://github.com/ceamac/wdisplays#branch=fix/C23'

@Talanor
Copy link
Copy Markdown

Talanor commented May 12, 2025

I'm not sure but AFAIK calling a function with wrong number of arguments is UB, i.e. this noop hack is not a valid way of doing the thing.

You're correct (6.3.2.3) :

A pointer to a function of one type may be converted to a pointer to a function of another type and
back again; the result shall compare equal to the original pointer. If a converted pointer is used to
call a function whose type is not compatible with the referenced type, the behavior is undefined

That being said, the fix works on my install as well ;)
A "cleaner" solution might be to make noop variants per pointer types where used.

@artizirk
Copy link
Copy Markdown
Owner

Thank you for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants