STINNER Victor <[email protected]> added the comment:
GH-32192 "Add _PyCFunction_CAST() macro" is special. It's used to define
functions in PyTypeObject.tp_methods or PyModuleDef.m_methods.
Casting a function pointer can cause issues with Control Flow Integrity (CFI)
implemented in LLVM. The _thread module has an undefined behavior fixed by the
commit 9eea6eaf23067880f4af3a130e3f67c9812e2f30 of bpo-33015. Previously, a
cast ignored that the callback has no return value, whereas pthread_create()
requires a function which as a void* return value.
To fix compiler warnings, the (PyCFunction)func cast was replaced with the
(PyCFunction)(void(*)(void))func cast to fix bpo-bpo-33012 GCC 8 compiler
warning:
warning: cast between incompatible function types (...)
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue47164>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com