Message412234
I stumbled upon the PR and tend to agree with Serhiy that this could be a source of nasty bugs. Passing the wrong type to a va_arg() argument is undefined behavior (e.g. https://wiki.sei.cmu.edu/confluence/display/c/EXP47-C.+Do+not+call+va_arg+with+an+argument+of+the+incorrect+type), and it does seem easy to do that by accident for an int-like type. For printf() compilers implement custom checks that make sure the types are right, but we don't get that luxury with Py_BuildValue(). It's also easy to make a bool yourself with the O code and Py_True/Py_False, so I don't think the additional code is worth the risk. |
|
Date |
User |
Action |
Args |
2022-02-01 03:59:43 | JelleZijlstra | set | recipients:
+ JelleZijlstra, vstinner, serhiy.storchaka, pablogsal, godlygeek |
2022-02-01 03:59:42 | JelleZijlstra | set | messageid: <1643687982.98.0.923521003472.issue45325@roundup.psfhosted.org> |
2022-02-01 03:59:42 | JelleZijlstra | link | issue45325 messages |
2022-02-01 03:59:42 | JelleZijlstra | create | |
|