New submission from Enji Cooper <yaneurab...@gmail.com>:

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

----------
components: C API
messages: 363785
nosy: ngie
priority: normal
severity: normal
status: open
title: C extension code reliant on static flags/behavior with PY_DEBUG 
(Py_SAFE_DOWNCAST, method flags) could potentially leverage _Static_assert

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

Reply via email to