diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2018-11-27 11:27:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-27 11:27:31 (GMT) |
commit | 62be74290aca26d16f3f55ece7ff6dad14e60e8d (patch) | |
tree | 656625bee7ca61fd87c6370407162522d8fb277f /Objects/call.c | |
parent | 81524022d0c0df7a41f9b2b2df41e2ebe140e610 (diff) | |
download | cpython-62be74290aca26d16f3f55ece7ff6dad14e60e8d.zip cpython-62be74290aca26d16f3f55ece7ff6dad14e60e8d.tar.gz cpython-62be74290aca26d16f3f55ece7ff6dad14e60e8d.tar.bz2 |
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.
Diffstat (limited to 'Objects/call.c')
-rw-r--r-- | Objects/call.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Objects/call.c b/Objects/call.c index ba2ddcb..be8e90d 100644 --- a/Objects/call.c +++ b/Objects/call.c @@ -514,7 +514,7 @@ _PyMethodDef_RawFastCallDict(PyMethodDef *method, PyObject *self, } if (flags & METH_KEYWORDS) { - result = (*(PyCFunctionWithKeywords)meth) (self, argstuple, kwargs); + result = (*(PyCFunctionWithKeywords)(void(*)(void))meth) (self, argstuple, kwargs); } else { result = (*meth) (self, argstuple); @@ -529,7 +529,7 @@ _PyMethodDef_RawFastCallDict(PyMethodDef *method, PyObject *self, goto no_keyword_error; } - result = (*(_PyCFunctionFast)meth) (self, args, nargs); + result = (*(_PyCFunctionFast)(void(*)(void))meth) (self, args, nargs); break; } @@ -537,7 +537,7 @@ _PyMethodDef_RawFastCallDict(PyMethodDef *method, PyObject *self, { PyObject *const *stack; PyObject *kwnames; - _PyCFunctionFastWithKeywords fastmeth = (_PyCFunctionFastWithKeywords)meth; + _PyCFunctionFastWithKeywords fastmeth = (_PyCFunctionFastWithKeywords)(void(*)(void))meth; if (_PyStack_UnpackDict(args, nargs, kwargs, &stack, &kwnames) < 0) { goto exit; @@ -650,12 +650,12 @@ _PyMethodDef_RawFastCallKeywords(PyMethodDef *method, PyObject *self, if (nkwargs) { goto no_keyword_error; } - result = ((_PyCFunctionFast)meth) (self, args, nargs); + result = ((_PyCFunctionFast)(void(*)(void))meth) (self, args, nargs); break; case METH_FASTCALL | METH_KEYWORDS: /* Fast-path: avoid temporary dict to pass keyword arguments */ - result = ((_PyCFunctionFastWithKeywords)meth) (self, args, nargs, kwnames); + result = ((_PyCFunctionFastWithKeywords)(void(*)(void))meth) (self, args, nargs, kwnames); break; case METH_VARARGS: @@ -689,7 +689,7 @@ _PyMethodDef_RawFastCallKeywords(PyMethodDef *method, PyObject *self, kwdict = NULL; } - result = (*(PyCFunctionWithKeywords)meth) (self, argtuple, kwdict); + result = (*(PyCFunctionWithKeywords)(void(*)(void))meth) (self, argtuple, kwdict); Py_XDECREF(kwdict); } else { @@ -752,7 +752,7 @@ cfunction_call_varargs(PyObject *func, PyObject *args, PyObject *kwargs) return NULL; } - result = (*(PyCFunctionWithKeywords)meth)(self, args, kwargs); + result = (*(PyCFunctionWithKeywords)(void(*)(void))meth)(self, args, kwargs); Py_LeaveRecursiveCall(); } |