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
./pyconfig.h:1438:0: warning: "_GNU_SOURCE" redefined [enabled by default] #74980
Comments
This is caused by _GNU_SOURCE being defined here: Line 124 in c08177a
Line 906 in c08177a
AC_USE_SYSTEM_EXTENSIONS does use an #ifndef but Python's AC_DEFINE seems to be getting order after it. |
Thanks for the report. This warning is currently visible on many/all of the buildbots on all branches. The conflict is caused by the upgrade of the bundled to libexpat to version 2.2.1 (bpo-30694). 2.2.1 introduced a define of _GNU_SOURCE into Modules/expat/xmlparse.c. The definition in xmlparse is simply: #define _GNU_SOURCE But Python, in pyconfig.h, which ./configure generates from pyconfig.h.in, may already have defined _GNU_SOURCE thusly: #define _GNU_SOURCE 1 pyconfig.h gets included into our copy of Modules/expat/expat_config.h which is included later in xmlparse.c causing the compile warning. The simplest way to avoid the warning is to just change the definition in xmlparse.c to match that in pyconfig.h; the compilers don't complain if the definition is identical. I have now merged that fix into the 3.6 branch so builders of 3.6.2 won't see the warning. I will leave this open for @Haypo to review and to handle merging into the other branches affected by bpo-30694 (master, 3.5, 2.7, 3.4, 3.3). |
One more thing: building with a recent gcc on Linux: also gives an "unused but set variable" warning. ./Modules/expat/xmlparse.c: In function ‘gather_time_entropy’:
./Modules/expat/xmlparse.c:780:7: warning: variable ‘gettimeofday_res’ set but not used [-Wunused-but-set-variable]
int gettimeofday_res;
^~~~~~~~~~~~~~~~ Since I didn't see it in time, I didn't try to fix this for 3.6.2 but it would be best to silence it going forward. |
The fix is now in 3.5-3.7 and 2.7, unless you intend to also back port to 3.4 and 3.3, this can be closed. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: