This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author JelleZijlstra
Recipients JelleZijlstra, godlygeek, pablogsal, serhiy.storchaka, vstinner
Date 2022-02-01.03:59:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1643687982.98.0.923521003472.issue45325@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2022-02-01 03:59:43JelleZijlstrasetrecipients: + JelleZijlstra, vstinner, serhiy.storchaka, pablogsal, godlygeek
2022-02-01 03:59:42JelleZijlstrasetmessageid: <1643687982.98.0.923521003472.issue45325@roundup.psfhosted.org>
2022-02-01 03:59:42JelleZijlstralinkissue45325 messages
2022-02-01 03:59:42JelleZijlstracreate