diff options
author | Victor Stinner <vstinner@python.org> | 2022-05-03 19:38:37 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-03 19:38:37 (GMT) |
commit | 551d02b3e697098236bb3a6e0a855b2ad8dc0424 (patch) | |
tree | ffa7db7f5129f7167df4c40bf4bbed2f5481c28b /Lib/test/test_cppext.py | |
parent | 456cd513e360ccd17e51ae3711ec48976b1be0c0 (diff) | |
download | cpython-551d02b3e697098236bb3a6e0a855b2ad8dc0424.zip cpython-551d02b3e697098236bb3a6e0a855b2ad8dc0424.tar.gz cpython-551d02b3e697098236bb3a6e0a855b2ad8dc0424.tar.bz2 |
gh-91321: Add _Py_NULL macro (#92253)
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.
Diffstat (limited to 'Lib/test/test_cppext.py')
-rw-r--r-- | Lib/test/test_cppext.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Lib/test/test_cppext.py b/Lib/test/test_cppext.py index fbb79bb..e056410 100644 --- a/Lib/test/test_cppext.py +++ b/Lib/test/test_cppext.py @@ -29,6 +29,8 @@ if not MS_WINDOWS: '-Werror', # Warn on old-style cast (C cast) like: (PyObject*)op '-Wold-style-cast', + # Warn when using NULL rather than _Py_NULL in static inline functions + '-Wzero-as-null-pointer-constant', ] else: # Don't pass any compiler flag to MSVC |