From 941d7054c1f73aa097bdc4e55ede819c8f123819 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 3 Jun 2022 00:59:57 +0200 Subject: gh-91320: Fix more old-style cast warnings in C++ (#93285) Use _PyObject_CAST() in the public C API to fix C++ compiler warnings: "use of old-style cast" (clang -Wold-style-cast). --- Include/pyerrors.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Include/pyerrors.h') diff --git a/Include/pyerrors.h b/Include/pyerrors.h index 34e3de3328..4944feecd8 100644 --- a/Include/pyerrors.h +++ b/Include/pyerrors.h @@ -62,7 +62,7 @@ PyAPI_FUNC(void) PyException_SetContext(PyObject *, PyObject *); PyAPI_FUNC(const char *) PyExceptionClass_Name(PyObject *); -#define PyExceptionInstance_Class(x) ((PyObject*)Py_TYPE(x)) +#define PyExceptionInstance_Class(x) _PyObject_CAST(Py_TYPE(x)) #define _PyBaseExceptionGroup_Check(x) \ PyObject_TypeCheck(x, (PyTypeObject *)PyExc_BaseExceptionGroup) -- cgit v1.2.1