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
Remove -Wunreachable-code flag #68512
Comments
Makefile.pre defines BASECFLAGS to include -Wunreachable-code. When building in the Linux environment available to me (GCC 4.4.6), compilation spews tons of warnings about "warning: will never be executed". According to this StackOverflow thread: http://stackoverflow.com/questions/14591778/ that flag was always broken in GCC and was eventually removed in 4.5. Maybe we should dispense with it when building Python, at least unless requested by the user. |
I guess this is an autoconf thing. "@BASECFLAGS@" in Makefile.pre.in seems to expand to "-Wsign-compare -Wunreachable-code" in Makefile.pre. |
This would definitely be nice to fix. I panicked a bit because of this when I compiled my extension modules against Python 3.5 for the first time. |
Can you please propose a patch? |
This seems to work for me. Diff against default. I have no idea how old the autoconf setup is here at work. I imagine you'll want to only apply the configure.ac patch and regenerate configure. |
New changeset 61f8f7610a88 by Ned Deily in branch '3.5': |
New changeset 8fecf6e17616 by Ned Deily in branch 'default': |
Thanks for the suggested patches. I used a somewhat different approach in an attempt to retain the benefit of the unreachable code warning when using other (non-GCC) compilers, in particular, llvm clang where the warnings do seem to be useful. |
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: