summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-11-27 11:27:31 (GMT)
committerGitHub <noreply@github.com>2018-11-27 11:27:31 (GMT)
commit62be74290aca26d16f3f55ece7ff6dad14e60e8d (patch)
tree656625bee7ca61fd87c6370407162522d8fb277f /Python
parent81524022d0c0df7a41f9b2b2df41e2ebe140e610 (diff)
downloadcpython-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 'Python')
-rw-r--r--Python/_warnings.c2
-rw-r--r--Python/bltinmodule.c18
-rw-r--r--Python/context.c2
-rw-r--r--Python/sysmodule.c6
4 files changed, 14 insertions, 14 deletions
diff --git a/Python/_warnings.c b/Python/_warnings.c
index 4065005..ccbc73f 100644
--- a/Python/_warnings.c
+++ b/Python/_warnings.c
@@ -1150,7 +1150,7 @@ PyDoc_STRVAR(warn_explicit_doc,
static PyMethodDef warnings_functions[] = {
WARNINGS_WARN_METHODDEF
- {"warn_explicit", (PyCFunction)warnings_warn_explicit,
+ {"warn_explicit", (PyCFunction)(void(*)(void))warnings_warn_explicit,
METH_VARARGS | METH_KEYWORDS, warn_explicit_doc},
{"_filters_mutated", (PyCFunction)warnings_filters_mutated, METH_NOARGS,
NULL},
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index f0d342a..e19bc56 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -2195,7 +2195,7 @@ PyDoc_STRVAR(builtin_sorted__doc__,
"reverse flag can be set to request the result in descending order.");
#define BUILTIN_SORTED_METHODDEF \
- {"sorted", (PyCFunction)builtin_sorted, METH_FASTCALL | METH_KEYWORDS, builtin_sorted__doc__},
+ {"sorted", (PyCFunction)(void(*)(void))builtin_sorted, METH_FASTCALL | METH_KEYWORDS, builtin_sorted__doc__},
static PyObject *
builtin_sorted(PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames)
@@ -2691,15 +2691,15 @@ PyTypeObject PyZip_Type = {
static PyMethodDef builtin_methods[] = {
- {"__build_class__", (PyCFunction)builtin___build_class__,
+ {"__build_class__", (PyCFunction)(void(*)(void))builtin___build_class__,
METH_FASTCALL | METH_KEYWORDS, build_class_doc},
- {"__import__", (PyCFunction)builtin___import__, METH_VARARGS | METH_KEYWORDS, import_doc},
+ {"__import__", (PyCFunction)(void(*)(void))builtin___import__, METH_VARARGS | METH_KEYWORDS, import_doc},
BUILTIN_ABS_METHODDEF
BUILTIN_ALL_METHODDEF
BUILTIN_ANY_METHODDEF
BUILTIN_ASCII_METHODDEF
BUILTIN_BIN_METHODDEF
- {"breakpoint", (PyCFunction)builtin_breakpoint, METH_FASTCALL | METH_KEYWORDS, breakpoint_doc},
+ {"breakpoint", (PyCFunction)(void(*)(void))builtin_breakpoint, METH_FASTCALL | METH_KEYWORDS, breakpoint_doc},
BUILTIN_CALLABLE_METHODDEF
BUILTIN_CHR_METHODDEF
BUILTIN_COMPILE_METHODDEF
@@ -2709,7 +2709,7 @@ static PyMethodDef builtin_methods[] = {
BUILTIN_EVAL_METHODDEF
BUILTIN_EXEC_METHODDEF
BUILTIN_FORMAT_METHODDEF
- {"getattr", (PyCFunction)builtin_getattr, METH_FASTCALL, getattr_doc},
+ {"getattr", (PyCFunction)(void(*)(void))builtin_getattr, METH_FASTCALL, getattr_doc},
BUILTIN_GLOBALS_METHODDEF
BUILTIN_HASATTR_METHODDEF
BUILTIN_HASH_METHODDEF
@@ -2721,13 +2721,13 @@ static PyMethodDef builtin_methods[] = {
{"iter", builtin_iter, METH_VARARGS, iter_doc},
BUILTIN_LEN_METHODDEF
BUILTIN_LOCALS_METHODDEF
- {"max", (PyCFunction)builtin_max, METH_VARARGS | METH_KEYWORDS, max_doc},
- {"min", (PyCFunction)builtin_min, METH_VARARGS | METH_KEYWORDS, min_doc},
- {"next", (PyCFunction)builtin_next, METH_FASTCALL, next_doc},
+ {"max", (PyCFunction)(void(*)(void))builtin_max, METH_VARARGS | METH_KEYWORDS, max_doc},
+ {"min", (PyCFunction)(void(*)(void))builtin_min, METH_VARARGS | METH_KEYWORDS, min_doc},
+ {"next", (PyCFunction)(void(*)(void))builtin_next, METH_FASTCALL, next_doc},
BUILTIN_OCT_METHODDEF
BUILTIN_ORD_METHODDEF
BUILTIN_POW_METHODDEF
- {"print", (PyCFunction)builtin_print, METH_FASTCALL | METH_KEYWORDS, print_doc},
+ {"print", (PyCFunction)(void(*)(void))builtin_print, METH_FASTCALL | METH_KEYWORDS, print_doc},
BUILTIN_REPR_METHODDEF
BUILTIN_ROUND_METHODDEF
BUILTIN_SETATTR_METHODDEF
diff --git a/Python/context.c b/Python/context.c
index 302f769..d6ef5b3 100644
--- a/Python/context.c
+++ b/Python/context.c
@@ -648,7 +648,7 @@ static PyMethodDef PyContext_methods[] = {
_CONTEXTVARS_CONTEXT_KEYS_METHODDEF
_CONTEXTVARS_CONTEXT_VALUES_METHODDEF
_CONTEXTVARS_CONTEXT_COPY_METHODDEF
- {"run", (PyCFunction)context_run, METH_FASTCALL | METH_KEYWORDS, NULL},
+ {"run", (PyCFunction)(void(*)(void))context_run, METH_FASTCALL | METH_KEYWORDS, NULL},
{NULL, NULL}
};
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 2284e88..0ca3de3 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -1521,7 +1521,7 @@ sys_getandroidapilevel(PyObject *self)
static PyMethodDef sys_methods[] = {
/* Might as well keep this in alphabetic order */
- {"breakpointhook", (PyCFunction)sys_breakpointhook,
+ {"breakpointhook", (PyCFunction)(void(*)(void))sys_breakpointhook,
METH_FASTCALL | METH_KEYWORDS, breakpointhook_doc},
{"callstats", sys_callstats, METH_NOARGS,
callstats_doc},
@@ -1560,7 +1560,7 @@ static PyMethodDef sys_methods[] = {
{"getrefcount", (PyCFunction)sys_getrefcount, METH_O, getrefcount_doc},
{"getrecursionlimit", sys_getrecursionlimit, METH_NOARGS,
getrecursionlimit_doc},
- {"getsizeof", (PyCFunction)sys_getsizeof,
+ {"getsizeof", (PyCFunction)(void(*)(void))sys_getsizeof,
METH_VARARGS | METH_KEYWORDS, getsizeof_doc},
{"_getframe", sys_getframe, METH_VARARGS, getframe_doc},
#ifdef MS_WINDOWS
@@ -1601,7 +1601,7 @@ static PyMethodDef sys_methods[] = {
set_coroutine_wrapper_doc},
{"get_coroutine_wrapper", sys_get_coroutine_wrapper, METH_NOARGS,
get_coroutine_wrapper_doc},
- {"set_asyncgen_hooks", (PyCFunction)sys_set_asyncgen_hooks,
+ {"set_asyncgen_hooks", (PyCFunction)(void(*)(void))sys_set_asyncgen_hooks,
METH_VARARGS | METH_KEYWORDS, set_asyncgen_hooks_doc},
{"get_asyncgen_hooks", sys_get_asyncgen_hooks, METH_NOARGS,
get_asyncgen_hooks_doc},