]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-92135: Fix _Py_reinterpret_cast() for const (#92138)
authorVictor Stinner <vstinner@python.org>
Mon, 2 May 2022 15:07:00 +0000 (17:07 +0200)
committerGitHub <noreply@github.com>
Mon, 2 May 2022 15:07:00 +0000 (17:07 +0200)
commit031397063e9c22711abfbf90f2617c8785cfc42c
tree08f64eeab6cbe6cebb51f44ddeb0f329c16ca9d3
parentb11243e85e020ed2f524bdd83c339faf11ef03d4
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.
Include/methodobject.h
Include/objimpl.h
Include/pyport.h
Lib/test/_testcppext.cpp
Lib/test/test_cppext.py