-
Notifications
You must be signed in to change notification settings - Fork 418
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
build: Fix compiler warnings #1906
Conversation
@MichelleJin12 Thank you, this issue could be reproduced in RHEL7 |
@@ -14,6 +14,8 @@ struct script_info; | |||
|
|||
#if defined(HAVE_LIBPYTHON2) || defined(HAVE_LIBPYTHON3) | |||
|
|||
#undef _XOPEN_SOURCE | |||
#undef _POSIX_C_SOURCE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right! This header file activated when configure
script have_libpython*
condition from existing user's libpython
.
Then, check-deps/Makefile
-> HAVE_LIBPYTHON*
macro would be enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Can you please add a comment that it's to fix the compiler warning on 2.7 and those two feature macros will be defined in the python header?
Fix compiler warnings when using python2.7 _POSIX_C_SOURCE and _XOPEN_SOURCE macros are defined in python header. /usr/include/python2.7/pyconfig-64.h:1191:0: error: "_POSIX_C_SOURCE" redefined [-Werror] #define _POSIX_C_SOURCE 200112L ^ In file included from /usr/include/inttypes.h:25:0, from /home/uftrace/libmcount/mcount.h:12, from /home/uftrace/utils/script.h:11, from /home/uftrace/utils/script.c:13: /usr/include/features.h:168:0: note: this is the location of the previous definition # define _POSIX_C_SOURCE 200809L ^ In file included from /usr/include/python2.7/pyconfig.h:6:0, from /usr/include/python2.7/Python.h:8, from /home/uftrace/utils/script-python.h:18, from /home/uftrace/utils/script.h:13, from /home/uftrace/utils/script.c:13: /usr/include/python2.7/pyconfig-64.h:1213:0: error: "_XOPEN_SOURCE" redefined [-Werror] #define _XOPEN_SOURCE 600 ^ In file included from /usr/include/inttypes.h:25:0, from /home/uftrace/libmcount/mcount.h:12, from /home/uftrace/utils/script.h:11, from /home/uftrace/utils/script.c:13: /usr/include/features.h:170:0: note: this is the location of the previous definition # define _XOPEN_SOURCE 700 ^ Fixed: namhyung#1276 Signed-off-by: Michelle Jin <shjy180909@gmail.com>
92eb931
to
403a7d3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Fix compiler warnings when using python2.7
Fixed: #1276
Signed-off-by: Michelle Jin shjy180909@gmail.com