This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/84531] c/c++: bogus warning for functions with different argument lengths but compatible arguments
- From: "bernd.edlinger at hotmail dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 25 Feb 2018 08:20:57 +0000
- Subject: [Bug c/84531] c/c++: bogus warning for functions with different argument lengths but compatible arguments
- Auto-submitted: auto-generated
- References: <bug-84531-4@http.gcc.gnu.org/bugzilla/>
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);