[issue47164] [C API] Add private "CAST" macros to clean up casts in C code

STINNER Victor report at bugs.python.org
Wed Mar 30 10:24:25 EDT 2022


STINNER Victor <vstinner at python.org> added the comment:

Hum, there are two things and maybe we are not talking about the same thing.

* (A) Modifying macros defined in the Python C API (Include/ header files) doing cast on their arguments to use CAST macros
* (B) Modify C code doing casts to use CAST macros

I created this issue for (A). I propose to do (B), but this part is optional.

Mark, Ken: are you fine with (A)? Is your concern about (B)?

But modifying macros to remove the cast of their argument is out of the scope of this issue. As I wrote, it would add compiler warnings, something that I would like to avoid. See:
https://peps.python.org/pep-0670/#cast-pointer-arguments

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue47164>
_______________________________________


More information about the Python-bugs-list mailing list