mirror of
https://github.com/python/cpython.git
synced 2026-10-28 10:25:05 +08:00
gh-144446: Fix _PyFrame_GetFrameObject() for test_cppext (C++) (#156893)
Do an explicit cast to fix the C++ compiler warning:
In file included from Include/internal/pycore_object.h:13,
from Include/internal/pycore_cell.h:5,
from extension.cpp:29:
Include/internal/pycore_interpframe.h: In function 'PyFrameObject*
_PyFrame_GetFrameObject(_PyInterpreterFrame*)':
Include/internal/pycore_pyatomic_ft_wrappers.h:33:32: error:
invalid conversion from 'void*' to 'PyFrameObject*' {aka '_frame*'}
[-fpermissive]
33 | _Py_atomic_load_ptr_acquire(&value)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
| |
| void*
Include/internal/pycore_interpframe.h:348:26: note: in expansion of
macro 'FT_ATOMIC_LOAD_PTR_ACQUIRE'
348 | PyFrameObject *res = FT_ATOMIC_LOAD_PTR_ACQUIRE(frame->frame_obj);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
1 parent
e13ecaeca2
commit
4dd225e940
1 file changed
+1
-1
@@ -345,7 +345,7 @@ _PyFrame_GetFrameObject(_PyInterpreterFrame *frame)
|
||||
{
|
||||
|
||||
assert(!_PyFrame_IsIncomplete(frame));
|
||||
PyFrameObject *res = FT_ATOMIC_LOAD_PTR_ACQUIRE(frame->frame_obj);
|
||||
PyFrameObject *res = (PyFrameObject*)FT_ATOMIC_LOAD_PTR_ACQUIRE(frame->frame_obj);
|
||||
if (res != NULL) {
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user