bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. (GH-6030)

METH_NOARGS functions need only a single argument but they are cast
into a PyCFunction, which takes two arguments.  This triggers an
invalid function cast warning in gcc8 due to the argument mismatch.
Fix this by adding a dummy unused argument.
This commit is contained in:
Siddhesh Poyarekar 2018-04-30 00:29:33 +05:30 committed by Serhiy Storchaka
parent 9f3535c9cd
commit 55edd0c185
56 changed files with 406 additions and 406 deletions

View file

@ -13792,7 +13792,7 @@ unicode_sizeof_impl(PyObject *self)
}
static PyObject *
unicode_getnewargs(PyObject *v)
unicode_getnewargs(PyObject *v, PyObject *Py_UNUSED(ignored))
{
PyObject *copy = _PyUnicode_Copy(v);
if (!copy)
@ -13853,7 +13853,7 @@ static PyMethodDef unicode_methods[] = {
{"_decimal2ascii", (PyCFunction) unicode__decimal2ascii, METH_NOARGS},
#endif
{"__getnewargs__", (PyCFunction)unicode_getnewargs, METH_NOARGS},
{"__getnewargs__", unicode_getnewargs, METH_NOARGS},
{NULL, NULL}
};
@ -15334,7 +15334,7 @@ unicodeiter_next(unicodeiterobject *it)
}
static PyObject *
unicodeiter_len(unicodeiterobject *it)
unicodeiter_len(unicodeiterobject *it, PyObject *Py_UNUSED(ignored))
{
Py_ssize_t len = 0;
if (it->it_seq)
@ -15345,7 +15345,7 @@ unicodeiter_len(unicodeiterobject *it)
PyDoc_STRVAR(length_hint_doc, "Private method returning an estimate of len(list(it)).");
static PyObject *
unicodeiter_reduce(unicodeiterobject *it)
unicodeiter_reduce(unicodeiterobject *it, PyObject *Py_UNUSED(ignored))
{
if (it->it_seq != NULL) {
return Py_BuildValue("N(O)n", _PyObject_GetBuiltin("iter"),