This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/84531] c/c++: bogus warning for functions with different argument lengths but compatible arguments


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);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]