-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
gh-91321: Add _Py_NULL macro #92253
gh-91321: Add _Py_NULL macro #92253
Conversation
Fix C++ compiler warnings: "zero as null pointer constant" (clang -Wzero-as-null-pointer-constant). * Add the _Py_NULL macro used by static inline functions to use nullptr in C++. * Replace NULL with nullptr in _testcppext.cpp.
I already had this issue and fixed it in pythoncapi-compat. I prepared a PR for pythoncapi-compat to reuse Python 3.11 _Py_NULL macro (this PR): python/pythoncapi-compat#36 |
Currently, with
|
I also got these errors on the CI of the datatabl project: see h2oai/datatable#3231 |
This breaks C-extensions builds with , e.g., |
In Python 3.11, I added test_cppext which checks that the Python C API is compatible with C++11. Do you care about older C++ versions? What is your OS (name and version) and C++ compiler (name and version)? |
Actually we're explicitly requiring |
I wrote #93784 to fix compatibility with C++ older than C++11. |
It's not intentional. My initial concern was to prevent C++ compiler warnings. |
Awesome, thank you very much ! |
Python 3.11 is now fixed: |
Fix C++ compiler warnings: "zero as null pointer constant"
(clang -Wzero-as-null-pointer-constant).
nullptr in C++.