-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
PYBIND11_NOINLINE-related cleanup. #3179
Conversation
Oops, I forgot to move this out of Draft ... again. Sorry. |
Thanks for the approvals! For completeness, I just did one more quick validation, only locally on my workstation, by changing this one line back in pytypes.h, while leaving everything else the same as in this PR: -bool isinstance_generic(handle obj, const std::type_info &tp);
+inline bool isinstance_generic(handle obj, const std::type_info &tp); With GCC 10.2.1, I'm counting 43 warnings when building all tests under That warning is really useful, clang 11 in contrast doesn't seem to have an equivalent warning, at least we're not activating it if it exists. Potential follow-on work item? Another potential follow-on work item: is there a way to get warnings about
|
Pure cleanup for correctness and consistency.
Motivated by ongoing work on removing GCC
-Wattributes
from the pragma block at the top of pybind11.h (see PR #3125 for full context), but technically completely independent and a worthwhile cleanup in its own right.Correctness aspect:
inline
.-Wattributes
from the pragma block at the top of pybind11.h. Note the corresponding#if
changes for thepragma GCC
in pybind11.h (lines 13 and 2387).Consistency aspect:
inline PYBIND11_NOINLINE
and 17 xPYBIND11_NOINLINE inline
. See lists below.inline
is added to thePYBIND11_NOINLINE
macro.Pointing out a special case in this PR (the only special case):
Converted from
inline
toPYBIND11_NOINLINE
, for consistency with an overload:Current master:
inline
first:inline
second: