diff options
author | Victor Stinner <vstinner@python.org> | 2022-05-02 15:07:00 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-02 15:07:00 (GMT) |
commit | 031397063e9c22711abfbf90f2617c8785cfc42c (patch) | |
tree | 08f64eeab6cbe6cebb51f44ddeb0f329c16ca9d3 /Include/objimpl.h | |
parent | b11243e85e020ed2f524bdd83c339faf11ef03d4 (diff) | |
download | cpython-031397063e9c22711abfbf90f2617c8785cfc42c.zip cpython-031397063e9c22711abfbf90f2617c8785cfc42c.tar.gz cpython-031397063e9c22711abfbf90f2617c8785cfc42c.tar.bz2 |
gh-92135: Fix _Py_reinterpret_cast() for const (#92138)
Fix C++ compiler warnings on cast macros, like _PyObject_CAST(), when
casting a constant expression to a non constant type: use
const_cast<> in C++.
* In C++, Py_SAFE_DOWNCAST() now uses static_cast<> rather than
reinterpret_cast<>.
* Add tests to the _testcppext C++ extension.
* test_cppext no longer captures stdout in verbose mode.
Diffstat (limited to 'Include/objimpl.h')
-rw-r--r-- | Include/objimpl.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Include/objimpl.h b/Include/objimpl.h index 94e0304..c8e57c9 100644 --- a/Include/objimpl.h +++ b/Include/objimpl.h @@ -182,9 +182,9 @@ PyAPI_FUNC(void) PyObject_GC_UnTrack(void *); PyAPI_FUNC(void) PyObject_GC_Del(void *); #define PyObject_GC_New(type, typeobj) \ - _Py_reinterpret_cast(type*, _PyObject_GC_New(typeobj)) + _Py_reinterpret_cast(type*, _PyObject_GC_New(typeobj)) #define PyObject_GC_NewVar(type, typeobj, n) \ - _Py_reinterpret_cast(type*, _PyObject_GC_NewVar((typeobj), (n))) + _Py_reinterpret_cast(type*, _PyObject_GC_NewVar((typeobj), (n))) PyAPI_FUNC(int) PyObject_GC_IsTracked(PyObject *); PyAPI_FUNC(int) PyObject_GC_IsFinalized(PyObject *); |