/usr/include/python3.15/pyport.h:494:9: error: ‘__STDC_VERSION__’ is not defined, evaluates to ‘0’ [-Werror=undef]
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 77.2k
- Forks
- 35.9k
- Métricas de merge de PR
- Métricas de PR pendientes
Descripción
Bug report
Bug description:
Hello. When building the kmymoney Fedora package, we got:
In file included from /usr/include/python3.15/Python.h:68,
from /builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/kmymoney/plugins/woob/interface/woobinterface.cpp:16:
/usr/include/python3.15/pyport.h:494:9: error: ‘__STDC_VERSION__’ is not defined, evaluates to ‘0’ [-Werror=undef]
494 | # elif __STDC_VERSION__ >= 201112L && !defined(__STDC_NO_THREADS__)
| ^~~~~~~~~~~~~~~~
The package uses g++, not gcc.
It has:
#include <Python.h>
The compiler invocation is:
cd /builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/redhat-linux-build/kmymoney/misc && /usr/bin/g++ -DKF_DEPRECATED_WARNINGS_SINCE=0x60000 -DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x56200C -DQT_CORE_LIB -DQT_DEPRECATED_WARNINGS_SINCE=0x60000 -DQT_DISABLE_DEPRECATED_BEFORE=0x50f02 -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_FROM_BYTEARRAY -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_FOREACH -DQT_NO_KEYWORDS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_URL_CAST_FROM_STRING -DQT_STRICT_ITERATORS -DQT_USE_QSTRINGBUILDER -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -Dkmm_gpgfile_EXPORTS -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/redhat-linux-build/kmymoney/misc -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/kmymoney/misc -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/redhat-linux-build/kmymoney/misc/kmm_gpgfile_autogen/include -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2 -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/redhat-linux-build -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/kmymoney -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/redhat-linux-build/kmymoney -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/kmymoney/settings -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/redhat-linux-build/kmymoney/settings -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/redhat-linux-build/kmymoney/dialogs -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/kmymoney/widgets -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/redhat-linux-build/kmymoney/widgets -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/kmymoney/mymoney -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/kmymoney/mymoney/storage -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/kmymoney/interfaces -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/redhat-linux-build/kmymoney/interfaces -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/kmymoney/plugins -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/redhat-linux-build/kmymoney/plugins -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/kmymoney/views -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/kmymoney/dialogs -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/kmymoney/converter -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/redhat-linux-build/kmymoney/dialogs/settings -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/redhat-linux-build/kmymoney/mymoney/storage -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/redhat-linux-build/kmymoney/mymoney -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/kmymoney/wizards/endingbalancedlg -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/redhat-linux-build/kmymoney/wizards/endingbalancedlg -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/kmymoney/wizards/newinvestmentwizard -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/redhat-linux-build/kmymoney/wizards/newinvestmentwizard -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/kmymoney/wizards/newloanwizard -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/redhat-linux-build/kmymoney/wizards/newloanwizard -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/kmymoney/wizards/wizardpages -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/kmymoney/models -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/redhat-linux-build/kmymoney/models -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/kmymoney/icons -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/redhat-linux-build/kmymoney/icons -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/kmymoney/menus -I/builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/redhat-linux-build/kmymoney/menus -isystem /usr/include/qt6/QtCore -isystem /usr/include/qt6 -isystem /usr/lib64/qt6/mkspecs/linux-g++ -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wall -Wextra -Wcast-align -Wchar-subscripts -Wformat-security -Wno-long-long -Wpointer-arith -Wundef -Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type -Werror=init-self -Werror=undef -Wvla -Wdate-time -Wsuggest-override -Wlogical-op -pedantic -Wzero-as-null-pointer-constant -Wmissing-include-dirs -fexceptions -DNDEBUG -std=c++17 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -UQT_NO_CAST_FROM_ASCII -UQT_NO_CAST_FROM_BYTEARRAY -UQT_NO_CAST_TO_ASCII -UQT_NO_CAST_TO_BYTEARRAY -Wall -Wextra -Wlogical-op -Wno-null-dereference -Wshadow -Wunused -Wno-misleading-indentation -Wsuggest-override -Wcast-qual -Wformat=2 -fno-common -Werror=return-type -Wzero-as-null-pointer-constant -MD -MT kmymoney/misc/CMakeFiles/kmm_gpgfile.dir/kmm_gpgfile_autogen/mocs_compilation.cpp.o -MF CMakeFiles/kmm_gpgfile.dir/kmm_gpgfile_autogen/mocs_compilation.cpp.o.d -o CMakeFiles/kmm_gpgfile.dir/kmm_gpgfile_autogen/mocs_compilation.cpp.o -c /builddir/build/BUILD/kmymoney-5.2.2-build/kmymoney-5.2.2/redhat-linux-build/kmymoney/misc/kmm_gpgfile_autogen/mocs_compilation.cpp
I think that 2cefa70eb92321c39f7d66bd862b2f66cd06f0fa might have exposed the # elif __STDC_VERSION__ >= 201112L && !defined(__STDC_NO_THREADS__) line outside of # ifdef Py_BUILD_CORE causign this issue.
I don't know yet if there is some other thing that makes other g++ code work and not this one, perhaps it's just the -Werror=undef part. Other code in CPython uses defined(__STDC_VERSION__) && __STDC_VERSION__ .... Perhaps this needs the same treatment?
Fedora bug report: https://bugzilla.redhat.com/show_bug.cgi?id=2440571 (fixed by disabling the woob plugin).
CPython versions tested on:
3.15
Operating systems tested on:
Linux
Linked PRs
- gh-154650
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza con Include/pyport.h alrededor de la línea 494 y el commit 2cefa70eb92321c39f7d66bd862b2f66cd06f0fa. Reproduce la compilación del header de CPython 3.15 usando g++ con -Werror=undef e inspecciona el PR vinculado gh-154650 para conocer la dirección actual. Se considera terminado cuando la inclusión de Python.h reportada ya no falla con la configuración de advertencias indicada.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- cpp, python
- Área
- build-system
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 25/100