-
-
Notifications
You must be signed in to change notification settings - Fork 31.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
bpo-37337: Fix a GCC 9 warning in Objects/descrobject.c #14814
Conversation
Commit b1263d5 causes GCC 9.1.0 to give a warning in Objects/descrobject.c.
Hi, @methane. Can you please merge this PR? |
The cast seems too complex to just avoid the warning. But I'm not sure there is a better way. If you want to this merged, please provide all casts you tried and demonstrate this is the simplest way to fix the warning. |
This is the standard way to avoid those warnings, there are many places in CPython with casts like that. It's also documented to do this: https://docs.python.org/3.8/extending/extending.html#keyword-parameters-for-extension-functions |
See bpo-33012 for the discussion about those casts. As far as I know, this is indeed the simplest way to cast between incompatible function pointers which does not generate warnings with GCC 9 and which does not rely on undefined behaviour and which is compatible with C++. |
OK, thank you. |
Thanks @ZackerySpytz for the PR, and @methane for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8. |
Sorry, @ZackerySpytz and @methane, I could not cleanly backport this to |
Commit b1263d5 causes GCC 9.1.0 to give a warning in Objects/descrobject.c.
Commit b1263d5 causes GCC 9.1.0 to give a warning in Objects/descrobject.c.
Commit b1263d5 causes GCC 9.1.0 to give a warning in Objects/descrobject.c.
Commit b1263d5 causes GCC 9.1.0 to
give a warning in Objects/descrobject.c.
https://bugs.python.org/issue37337