[Bug c/84531] c/c++: bogus warning for functions with different argument lengths but compatible arguments
bernd.edlinger at hotmail dot de
gcc-bugzilla@gcc.gnu.org
Sun Feb 25 08:59:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84531
--- Comment #3 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
Actually the warning on PyCFunctionWithoutArgs
is _not_ a false positive:
I am looking at Python-3.6.1 right now.
What I see is that functions with no arguments
have the signature "PyObject * (*)(PyObject *)"
but on the call side the Call passes two arguments
see Python-3.6.1/Objects/methodobject.c:
case METH_NOARGS:
size = PyTuple_GET_SIZE(args);
if (size != 0) {
PyErr_Format(PyExc_TypeError,
"%.200s() takes no arguments (%zd given)",
f->m_ml->ml_name, size);
return NULL;
}
res = (*meth)(self, NULL);
More information about the Gcc-bugs
mailing list