-
-
Notifications
You must be signed in to change notification settings - Fork 34.1k
gh-121617: Include <string.h> for Py_CLEAR() macro #144666
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
If the _Py_TYPEOF macro is not available, include <string.h> to get memcpy() for the Py_CLEAR() macro. The limited C API version 3.11 and newer doesn't include <string.h> anymore. Add a Py_CLEAR() test in test_cext. Modify also _Py_TYPEOF to use C23 typeof() if available.
|
If this change is merged in the main branch, I will write a backport to the 3.14 branch without the C23 change using |
|
Note: |
|
The documentation also needs an update. (3.14 has the list here.) It's somewhat hard to explain, unfortunately. Is it enough to add something vague like “ |
|
I added the following sentence to the doc:
I'm not sure if it's worth it to document this corner case. |
|
It looks hard to explain. Is it a good idea? Looking more into this, I see
Plus, I think we want to be able to use I think we should go ahead and always include |
Ok, let's do that. |
|
🤖 New build scheduled with the buildbot fleet by @encukou for commit b6082ac 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F144666%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
encukou
left a comment
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.
Thanks!
Let's wait for buildbots; they've been grumpy about test_c[pp]ext lately.
|
Merged. Thanks for the review @encukou. |
The PEP 810 implementation introduced a minor incompatibility. It has been fixed quickly by commit 7854597. typedef enum {
PyImport_LAZY_NORMAL,
PyImport_LAZY_ALL,
- PyImport_LAZY_NONE,
+ PyImport_LAZY_NONE
} PyImport_LazyImportsMode;The buildbot tests passed successfully on this PR ;-) |
If the _Py_TYPEOF macro is not available, include <string.h> to get memcpy() for the Py_CLEAR() macro. The limited C API version 3.11 and newer doesn't include <string.h> anymore.
Add a Py_CLEAR() test in test_cext.
Modify also _Py_TYPEOF to use C23 typeof() if available.
memcpy()usage without#include <string.h>inpwdmodule.c#121617