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 due to -Wdeprecated-declarations #80

Open
glaubitz opened this issue Jun 5, 2024 · 1 comment · May be fixed by #81
Open

Fails to build with GCC 14 due to -Wdeprecated-declarations #80

glaubitz opened this issue Jun 5, 2024 · 1 comment · May be fixed by #81

Comments

@glaubitz
Copy link

glaubitz commented Jun 5, 2024

Trying to build pylzma with GCC 14 fails with:

[   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/ -fPIC -DPY_SSIZE_T_CLEAN=1 -DWITH_COMPAT=1 -DPYLZMA_VERSION=0.5.0 -D_7ZIP_ST=1 -Isrc/sdk/C -I/usr/include/python3.10 -c src/compat/LzmaCompatDecode.c -o build/temp.linux-x86_64-cpython-310/src/compat/LzmaCompatDecode.o
[   14s]   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/ -fPIC -DPY_SSIZE_T_CLEAN=1 -DWITH_COMPAT=1 -DPYLZMA_VERSION=0.5.0 -D_7ZIP_ST=1 -Isrc/sdk/C -I/usr/include/python3.10 -c src/pylzma/pylzma.c -o build/temp.linux-x86_64-cpython-310/src/pylzma/pylzma.o
[   14s]   src/pylzma/pylzma.c: In function ‘PyInit_pylzma’:
[   14s]   src/pylzma/pylzma.c:296:5: warning: ‘PyEval_InitThreads’ is deprecated [-Wdeprecated-declarations]
[   14s]     296 |     PyEval_InitThreads();
[   14s]         |     ^~~~~~~~~~~~~~~~~~
[   14s]   In file included from /usr/include/python3.10/Python.h:130,
[   14s]                    from src/pylzma/pylzma.c:26:
[   14s]   /usr/include/python3.10/ceval.h:122:37: note: declared here
[   14s]     122 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void);
[   14s]         |                                     ^~~~~~~~~~~~~~~~~~
[   14s]   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/ -fPIC -DPY_SSIZE_T_CLEAN=1 -DWITH_COMPAT=1 -DPYLZMA_VERSION=0.5.0 -D_7ZIP_ST=1 -Isrc/sdk/C -I/usr/include/python3.10 -c src/pylzma/pylzma_aes.c -o build/temp.linux-x86_64-cpython-310/src/pylzma/pylzma_aes.o
[   14s]   src/pylzma/pylzma_aes.c:158:5: error: initialization of ‘long int’ from ‘void *’ makes integer from pointer without a cast [-Wint-conversion]
[   14s]     158 |     NULL,                                /* printfunc  tp_print;   */
[   14s]         |     ^~~~
[   14s]   src/pylzma/pylzma_aes.c:158:5: note: (near initialization for ‘CAESDecrypt_Type.tp_vectorcall_offset’)
[   14s]   error: command '/usr/bin/gcc' failed with exit code 1
[   14s]   error: subprocess-exited-with-error
[   14s]   
[   14s]   × Building wheel for pylzma (pyproject.toml) did not run successfully.
[   14s]   │ exit code: 1
[   14s]   ╰─> See above for output.
[   14s]   
[   14s]   note: This error originates from a subprocess, and is likely not a problem with pip.
[   14s]   full command: /usr/bin/python3.10 /usr/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /tmp/tmpdhloe_ms
[   14s]   cwd: /home/abuild/rpmbuild/BUILD/pylzma-0.5.0
[   14s]   Building wheel for pylzma (pyproject.toml): finished with status 'error'
[   14s]   ERROR: Failed building wheel for pylzma

To reproduce the error, build pylzma with GCC 14 as the default C/C++ compiler.

@mawbid
Copy link

mawbid commented Sep 24, 2024

I hit this error as well, on macOS with clang 16.

src/pylzma/pylzma_aes.c:158:5: error: incompatible pointer to integer conversion initializing 'Py_ssize_t' (aka 'long') with an expression of type 'void *' [-Wint-conversion]

I get the error on python versions lower than 12. On python 12, pylzma installs without errors or warnings (well, except the deprecation warning about legacy 'setup.py install' method).

On affected python versions, a workaround exists:

CFLAGS=-Wno-int-conversion pip install pylzma

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.

2 participants