Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-91320: Add _Py_reinterpret_cast() macro #91959

Merged
merged 2 commits into from
Apr 27, 2022
Merged

gh-91320: Add _Py_reinterpret_cast() macro #91959

merged 2 commits into from
Apr 27, 2022

Commits on Apr 26, 2022

  1. gh-91320: Add _Py_reinterpret_cast() macro

    Fix C++ compiler warnings about "old-style cast"
    (g++ -Wold-style-cast) in the Python C API.  Use C++
    reinterpret_cast<> and static_cast<> casts when the Python C API is
    used in C++.
    
    Example of fixed warning:
    
        Include/object.h:107:43: error: use of old-style cast to
        ‘PyObject*’ {aka ‘struct _object*’} [-Werror=old-style-cast]
        #define _PyObject_CAST(op) ((PyObject*)(op))
    
    Add _Py_reinterpret_cast() and _Py_static_cast() macros.
    vstinner committed Apr 26, 2022
    Configuration menu
    Copy the full SHA
    06aeb11 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    01b1bae View commit details
    Browse the repository at this point in the history