Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to build with GCC 15 due to -Wincompatible-pointer-types #288

Open
glaubitz opened this issue Feb 10, 2025 · 1 comment
Open

Fails to build with GCC 15 due to -Wincompatible-pointer-types #288

glaubitz opened this issue Feb 10, 2025 · 1 comment

Comments

@glaubitz
Copy link

With GCC 15, function declarations with no parameters can no longer be used for functions that take parameters.

As a result, pyo fails to build from source with GCC 15 with the following error:

[   13s] gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -g -DOPENSSL_LOAD_CONF -fwrapv -fno-semantic-interposition -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -g -IVendor/ -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -g -IVendor/ -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -fPIC -DUSE_PORTAUDIO -DUSE_PORTMIDI -DUSE_OSC -DUSE_JACK -DJACK_NEW_API -Iinclude -I/usr/include -I/usr/local/include -I/usr/include/python3.12 -c src/engine/dummymodule.c -o build/temp.linux-x86_64-cpython-312/src/engine/dummymodule.o -Wno-strict-prototypes -Wno-strict-aliasing -O3 -g0 -DNDEBUG
[   13s] src/engine/dummymodule.c: In function ‘Dummy_setProcMode’:
[   13s] src/engine/dummymodule.c:48:35: error: assignment to ‘void (*)(void)’ from incompatible pointer type ‘void (*)(Dummy *)’ [-Wincompatible-pointer-types]
[   13s]    48 |             self->muladd_func_ptr = Dummy_postprocessing_ii;
[   13s]       |                                   ^
[   13s] src/engine/dummymodule.c:29:13: note: ‘Dummy_postprocessing_ii’ declared here
[   13s]    29 | static void Dummy_postprocessing_ii(Dummy *self) { POST_PROCESSING_II };
[   13s]       |             ^~~~~~~~~~~~~~~~~~~~~~~
[   13s] src/engine/dummymodule.c:52:35: error: assignment to ‘void (*)(void)’ from incompatible pointer type ‘void (*)(Dummy *)’ [-Wincompatible-pointer-types]
[   13s]    52 |             self->muladd_func_ptr = Dummy_postprocessing_ai;
[   13s]       |                                   ^
[   13s] src/engine/dummymodule.c:30:13: note: ‘Dummy_postprocessing_ai’ declared here
[   13s]    30 | static void Dummy_postprocessing_ai(Dummy *self) { POST_PROCESSING_AI };
[   13s]       |             ^~~~~~~~~~~~~~~~~~~~~~~
@belangeo
Copy link
Owner

belangeo commented Mar 2, 2025

That would be too much of a refactor to do this at the moment (not even sure how I will handle that)... I can repro in godbolt, but Apple clang seems to be more compliant than gcc! Is it working on your side if you add "-Wno-incompatible-pointer-types" in the extra_compile_args?

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

No branches or pull requests

2 participants