Fails to build with GCC 14 due to -Wincompatible-pointer-types
glaubitz opened this issue · comments
Trying to build pyo
with GCC 14 fails with:
[ 50s] gcc -Wno-unused-result -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.10 -c src/engine/osclistenermodule.c -o build/temp.linux-x86_64-cpython-310/src/engine/osclistenermodule.o -Wno-strict-prototypes -Wno-strict-aliasing -O3 -g0 -DNDEBUG
[ 50s] src/engine/osclistenermodule.c: In function ‘process_osc’:
[ 50s] src/engine/osclistenermodule.c:93:22: error: assignment to ‘struct lo_blob_ **’ from incompatible pointer type ‘struct lo_blob_ *’ [-Wincompatible-pointer-types]
[ 50s] 93 | blob = (lo_blob)argv[i];
[ 50s] | ^
[ 50s] src/engine/osclistenermodule.c:94:45: error: passing argument 1 of ‘lo_blob_datasize’ from incompatible pointer type [-Wincompatible-pointer-types]
[ 50s] 94 | blobsize = lo_blob_datasize(blob);
[ 50s] | ^~~~
[ 50s] | |
[ 50s] | struct lo_blob_ **
[ 50s] In file included from src/engine/osclistenermodule.c:25:
[ 50s] /usr/include/lo/lo.h:223:35: note: expected ‘lo_blob’ {aka ‘struct lo_blob_ *’} but argument is of type ‘struct lo_blob_ **’
[ 50s] 223 | uint32_t lo_blob_datasize(lo_blob b);
[ 50s] | ~~~~~~~~^
[ 50s] src/engine/osclistenermodule.c:95:44: error: passing argument 1 of ‘lo_blob_dataptr’ from incompatible pointer type [-Wincompatible-pointer-types]
[ 50s] 95 | blobdata = lo_blob_dataptr(blob);
[ 50s] | ^~~~
[ 50s] | |
[ 50s] | struct lo_blob_ **
[ 50s] /usr/include/lo/lo.h:231:31: note: expected ‘lo_blob’ {aka ‘struct lo_blob_ *’} but argument is of type ‘struct lo_blob_ **’
[ 50s] 231 | void *lo_blob_dataptr(lo_blob b);
[ 50s] | ~~~~~~~~^
[ 50s] src/engine/osclistenermodule.c: In function ‘OscListener_new’:
[ 50s] src/engine/osclistenermodule.c:187:56: error: passing argument 4 of ‘lo_server_add_method’ from incompatible pointer type [-Wincompatible-pointer-types]
[ 50s] 187 | lo_server_add_method(self->osc_server, NULL, NULL, process_osc, (void *)self);
[ 50s] | ^~~~~~~~~~~
[ 50s] | |
[ 50s] | int (*)(const char *, const char *, lo_arg **, int, void *, void *)
[ 50s] In file included from /usr/include/lo/lo.h:32:
[ 50s] /usr/include/lo/lo_lowlevel.h:876:72: note: expected ‘lo_method_handler’ {aka ‘int (*)(const char *, const char *, lo_arg **, int, struct lo_message_ *, void *)’} but argument is of type ‘int (*)(const char *, const char *, lo_arg **, int, void *, void *)’
[ 50s] 876 | const char *typespec, lo_method_handler h,
[ 50s] | ~~~~~~~~~~~~~~~~~~^
[ 50s] error: command '/usr/bin/gcc' failed with exit code 1
Reproducible by using GCC 14 as the default C/C++ compiler.
I got the same error also
I got similar on a mac with clang:
src/engine/osclistenermodule.c:187:56: error: incompatible function pointer types passing 'int (const char *, const char *, lo_arg **, int, void *, void *)' to parameter of type 'lo_method_handler' (aka 'int (*)(const char *, const char *, lo_arg **, int, struct lo_message_ *, void *)') [-Wincompatible-function-pointer-types]
lo_server_add_method(self->osc_server, NULL, NULL, process_osc, (void *)self);
^~~~~~~~~~~
/opt/homebrew/include/lo/lo_lowlevel.h:876:72: note: passing argument to parameter 'h' here
const char *typespec, lo_method_handler h,
^
194 warnings and 1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
python setup.py install --minimal
works though - so it looks like it's a third party dependency - ie the osc lib - which is breaking things (not gcc or clang)
python setup.py install --minimal
works though - so it looks like it's a third party dependency - ie the osc lib - which is breaking things (not gcc or clang)
Yeah its libloc that's causing the error, running --minimal excludes it.
from pyo docs:
"
If you want to compile pyo with minimal dependencies (mostly for integrated use in a host environment):
--minimal
"