Don't build _testcppext.cpp with -Wzero-as-null-pointer-constant when
testing C++03: only use this compiler flag with C++11.
'-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
name = '_testcpp11ext'
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(
name,
sources=[SOURCE],