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

Fix invalid function cast warnings with gcc 8
for method conventions different from METH_NOARGS, METH_O and
METH_VARARGS excluding Argument Clinic generated code.
This commit is contained in:
Serhiy Storchaka 2018-11-27 13:27:31 +02:00 committed by GitHub
parent 81524022d0
commit 62be74290a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 174 additions and 174 deletions

View file

@ -3481,7 +3481,7 @@ type___sizeof___impl(PyTypeObject *self)
static PyMethodDef type_methods[] = {
TYPE_MRO_METHODDEF
TYPE___SUBCLASSES___METHODDEF
{"__prepare__", (PyCFunction)type_prepare,
{"__prepare__", (PyCFunction)(void(*)(void))type_prepare,
METH_FASTCALL | METH_KEYWORDS | METH_CLASS,
PyDoc_STR("__prepare__() -> dict\n"
"used to create the namespace for the class statement")},
@ -5944,7 +5944,7 @@ tp_new_wrapper(PyObject *self, PyObject *args, PyObject *kwds)
}
static struct PyMethodDef tp_new_methoddef[] = {
{"__new__", (PyCFunction)tp_new_wrapper, METH_VARARGS|METH_KEYWORDS,
{"__new__", (PyCFunction)(void(*)(void))tp_new_wrapper, METH_VARARGS|METH_KEYWORDS,
PyDoc_STR("__new__($type, *args, **kwargs)\n--\n\n"
"Create and return a new object. "
"See help(type) for accurate signature.")},
@ -7140,7 +7140,7 @@ update_one_slot(PyTypeObject *type, slotdef *p)
}
else if (Py_TYPE(descr) == &PyCFunction_Type &&
PyCFunction_GET_FUNCTION(descr) ==
(PyCFunction)tp_new_wrapper &&
(PyCFunction)(void(*)(void))tp_new_wrapper &&
ptr == (void**)&type->tp_new)
{
/* The __new__ wrapper is not a wrapper descriptor,