Mark Dickinson <dicki...@gmail.com> added the comment: > The compiler has no chance to find out. You cast the pointer to > PyCFunction, telling the compiler that it really is a PyCFunction.
True; I was thinking that the compiler should have the necessary information to warn about the suspicious (PyCFunction) cast. But then again the function pointer cast is perfectly legal---it's the subsequent call that invokes undefined behaviour, and that's in a different file, so the compiler can't help. > "Everywhere" is nowhere close to the truth. Yep, sorry; bad wording on my part. I didn't intend to imply that all uses of METH_NOARGS had this problem. 'Everywhere' for very small values of 'everywhere'. :-) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15402> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com