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 14 as the default compiler due to -Wincompatible-pointer-types #57

Closed
glaubitz opened this issue May 31, 2024 · 0 comments · Fixed by #58
Closed

Comments

@glaubitz
Copy link

Trying to build py-radix with GCC 14 fails due to -Wincompatible-pointer-types:

[   13s] 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 -I/home/abuild/rpmbuild/BUILD/py-radix-0.10.0/radix -I/usr/include/python3.10 -c radix/_radix.c -o build/temp.linux-x86_64-cpython-310/radix/_radix.o
[   13s] radix/_radix.c: In function ‘add_node_to_list’:
[   13s] radix/_radix.c:527:37: error: passing argument 2 of ‘PyList_Append’ from incompatible pointer type [-Wincompatible-pointer-types]
[   13s]   527 |                 PyList_Append(ret, ((RadixNodeObject *)node->data));
[   13s]       |                                    ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[   13s]       |                                     |
[   13s]       |                                     RadixNodeObject *
[   13s] In file included from /usr/include/python3.10/Python.h:92,
[   13s]                  from radix/_radix.c:17:
[   13s] /usr/include/python3.10/listobject.h:34:43: note: expected ‘PyObject *’ {aka ‘struct _object *’} but argument is of type ‘RadixNodeObject *’
[   13s]    34 | PyAPI_FUNC(int) PyList_Append(PyObject *, PyObject *);
[   13s]       |                                           ^~~~~~~~~~
[   13s] error: command '/usr/bin/gcc' failed with exit code 1

To reproduce, use GCC 14 as the default C/C++ compiler.

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 a pull request may close this issue.

1 participant