gh-94731: Revert to C-style casts for _Py_CAST (GH-94782)

Co-authored-by: da-woods <dw-git@d-woods.co.uk>
This commit is contained in:
Petr Viktorin 2022-07-14 11:57:18 +02:00 committed by GitHub
parent 81dca70d70
commit 6cbb57f62d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 85 additions and 59 deletions

View file

@ -17,8 +17,6 @@ if not MS_WINDOWS:
# a C++ extension using the Python C API does not emit C++ compiler
# warnings
'-Werror',
# Warn on old-style cast (C cast) like: (PyObject*)op
'-Wold-style-cast',
]
else:
# Don't pass any compiler flag to MSVC
@ -37,9 +35,6 @@ def main():
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,