-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Limiting pragma for ignoring GCC 7 -Wnoexcept-type to the scope of pybind11.h. #3161
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
Conversation
…comment about the dicy nature of -Wnoexcept-type ("if and only if").
include/pybind11/pybind11.h
Outdated
It seems very unlikely that this warning will be useful to anyone (no other GCC version | ||
generates it), but to be maximally accommodating we turn it off here instead of using a | ||
command line option. |
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.
other GCC version generates it
🤣
It seems very unlikely that this warning will be useful to anyone (no other GCC version | |
generates it), but to be maximally accommodating we turn it off here instead of using a | |
command line option. | |
No other GCC version generates this warning. |
Too much information, we want pybind11 to compile out of the box with no warnings if possible, and that's why we carefully remove a few warnings, including this one.
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.
Change applied. Thanks!
Thanks Henry! The one failing CI job is a test_iostream flake. Safe to ignore, especially because it worked in the previous CI run and the only change was to a comment. |
…bind11.h. (#3161) * Moving pragma for ignoring -Wnoexcept-type to the one location where it is needed. * Trying a second location. * The previous commit worked (GitHub Actions green), but see the added comment about the dicy nature of -Wnoexcept-type ("if and only if"). * Applying reviewer suggestion.
Follow-on to PR #3127, based on results obtained under PR #3125.
Note that the pragma for
-Wnoexcept-type
is moved from above to below all#include
s. This unblocks refactoring and IWYU cleanup (and eventually merging the smart_holder branch).It is somewhat of a coincidence that the moved pragma is still in the same header file. Potentially, the pragma for
-Wnoexcept-type
may need to be copied to refactored header files, but that's the price we have to pay for improved code organization with the added requirement to not suppress warnings from the command line (for portability).The suggested changelog entry will be in the final PR of this cleanup series.
Worksheet