https://github.com/python/cpython/commit/4dd225e940001eb96071e56d258e4e6b74b07f8b
commit: 4dd225e940001eb96071e56d258e4e6b74b07f8b
branch: main
author: Victor Stinner <[email protected]>
committer: vstinner <[email protected]>
date: 2026-09-03T16:17:07+02:00
summary:

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);
        |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~

files:
M Include/internal/pycore_interpframe.h

diff --git a/Include/internal/pycore_interpframe.h 
b/Include/internal/pycore_interpframe.h
index 812e1a28debef4..a85fa9bd32853c 100644
--- a/Include/internal/pycore_interpframe.h
+++ b/Include/internal/pycore_interpframe.h
@@ -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;
     }

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to