Message363785
Looking at Py_SAFE_DOWNCAST, it seems that the code could (in theory) leverage _Static_assert on C11 capable compilers [1].
Looking at some other code APIs, like module initialization with METH_VARARGS, etc, there are ways to determine whether or not the values are valid at compile-time with C11 capable compilers, instead of figuring out the issues on the tail end at runtime and having to play whackamole figuring out which offending methods are triggering issues (see also: bpo-39884).
1. https://en.cppreference.com/w/c/language/_Static_assert |
|
Date |
User |
Action |
Args |
2020-03-09 23:15:35 | ngie | set | recipients:
+ ngie |
2020-03-09 23:15:35 | ngie | set | messageid: <1583795735.01.0.546271118334.issue39919@roundup.psfhosted.org> |
2020-03-09 23:15:34 | ngie | link | issue39919 messages |
2020-03-09 23:15:34 | ngie | create | |
|