-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
bpo-45434: Only exclude <stdlib.h> in Python 3.11 limited C API #29027
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
The Python 3.11 limited C API no longer includes stdlib.h, stdio.h, string.h and errno.h. * Exclude Py_MEMCPY() from Python 3.11 limited C API. * xxlimited C extension is now built with Python 3.11 limited C API.
|
@Yhg1s @ronaldoussoren @encukou @tiran: Does it look a reasonable approach to you? Only change the Python 3.11 limited C API, but leave other APIs unchanged? |
|
I not sure if doing this is worth the effort, this makes the headers more complicated and only affects the few extensions that target the stable ABI and want to use API's introduced in 3.11. |
I think it's worth doing. In the long run it's going to make |
|
@tiran: I addresssed your review. |
You only have to do this update work once. Once you added the missing |
Doc/whatsnew/3.11.rst
Outdated
| * The Python 3.11 limited C API no longer includes ``<stdlib.h>``, | ||
| ``<stdio.h>``, ``<errno.h>`` and ``<string.h>``: | ||
| if ``Py_LIMITED_API >= 0x030b0000``. C extensions using these headers must | ||
| now include them explicitly. |
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.
The whatsnew entry is hard to understand.
| * The Python 3.11 limited C API no longer includes ``<stdlib.h>``, | |
| ``<stdio.h>``, ``<errno.h>`` and ``<string.h>``: | |
| if ``Py_LIMITED_API >= 0x030b0000``. C extensions using these headers must | |
| now include them explicitly. | |
| * ``<Python.h>`` no longer includes the header files ``<stdlib.h>``, | |
| ``<stdio.h>``, ``<errno.h>`` and ``<string.h>`` when ``Py_LIMITED_API`` | |
| is set to ``0x030b0000`` (3.11) or higher. C extensions should explicitly | |
| include the header files after ``#include <Python.h>``. |
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.
I confess that it's hard to understand. I copied your rephrased paragraph, thanks.
The Python 3.11 limited C API no longer includes stdlib.h, stdio.h,
string.h and errno.h.
https://bugs.python.org/issue45434