STINNER Victor added the comment: > So once these functions are decorated with this attribute, what kind of > testing/validation you have in mind, please let me know.
Call PyMem_Malloc(Py_ssize_t) for example: it must emit a warning on GCC 7, since casting negative values to size_t overflows. Not sure how to test the attribute on GCC 6. Maybe some GCC related static analyzers are able to detect memory leaks like: void test(void) { void *ptr = PyMem_Malloc(16); /* don't free ptr */ } ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29674> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com