Jelle Zijlstra <jelle.zijls...@gmail.com> added the comment:

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.

----------
nosy: +Jelle Zijlstra

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45325>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to