mirror of
https://github.com/python/cpython.git
synced 2025-07-23 19:25:40 +00:00
gh-91321: Fix test_cppext for C++03 (#93902)
Don't build _testcppext.cpp with -Wzero-as-null-pointer-constant when testing C++03: only use this compiler flag with C++11.
This commit is contained in:
parent
7546914e3f
commit
a38c2a61d5
1 changed files with 4 additions and 2 deletions
|
@ -19,8 +19,6 @@ if not MS_WINDOWS:
|
||||||
'-Werror',
|
'-Werror',
|
||||||
# Warn on old-style cast (C cast) like: (PyObject*)op
|
# Warn on old-style cast (C cast) like: (PyObject*)op
|
||||||
'-Wold-style-cast',
|
'-Wold-style-cast',
|
||||||
# Warn when using NULL rather than _Py_NULL in static inline functions
|
|
||||||
'-Wzero-as-null-pointer-constant',
|
|
||||||
]
|
]
|
||||||
else:
|
else:
|
||||||
# Don't pass any compiler flag to MSVC
|
# Don't pass any compiler flag to MSVC
|
||||||
|
@ -39,6 +37,10 @@ def main():
|
||||||
name = '_testcpp11ext'
|
name = '_testcpp11ext'
|
||||||
|
|
||||||
cppflags = [*CPPFLAGS, f'-std={std}']
|
cppflags = [*CPPFLAGS, f'-std={std}']
|
||||||
|
if std == 'c++11':
|
||||||
|
# Warn when using NULL rather than _Py_NULL in static inline functions
|
||||||
|
cppflags.append('-Wzero-as-null-pointer-constant')
|
||||||
|
|
||||||
cpp_ext = Extension(
|
cpp_ext = Extension(
|
||||||
name,
|
name,
|
||||||
sources=[SOURCE],
|
sources=[SOURCE],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue