Skip to content

Commit 4dd225e

Browse files
authored
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); | ^~~~~~~~~~~~~~~~~~~~~~~~~~
1 parent e13ecae commit 4dd225e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Include/internal/pycore_interpframe.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ _PyFrame_GetFrameObject(_PyInterpreterFrame *frame)
345345
{
346346

347347
assert(!_PyFrame_IsIncomplete(frame));
348-
PyFrameObject *res = FT_ATOMIC_LOAD_PTR_ACQUIRE(frame->frame_obj);
348+
PyFrameObject *res = (PyFrameObject*)FT_ATOMIC_LOAD_PTR_ACQUIRE(frame->frame_obj);
349349
if (res != NULL) {
350350
return res;
351351
}

0 commit comments

Comments
 (0)