mirror of
https://github.com/python/cpython.git
synced 2025-09-07 09:21:27 +00:00
gh-91320: Fix more old-style cast warnings in C++ (#92247)
Use _Py_CAST(), _Py_STATIC_CAST() and _PyASCIIObject_CAST() in static inline functions to fix C++ compiler warnings: "use of old-style cast" (clang -Wold-style-cast). test_cppext now builds the C++ test extension with -Wold-style-cast.
This commit is contained in:
parent
b270b82f11
commit
ff3e9cdf33
3 changed files with 19 additions and 16 deletions
|
@ -27,6 +27,8 @@ 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue