Skip to content

Commit 1c60715

Browse files
bpo-33012: Fix more invalid function cast warnings with gcc 8. (GH-10751)
Fix warnings with gcc 8 for wrapperfunc <-> wrapperfunc_kwds casts.
1 parent c57e6e2 commit 1c60715

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Objects/descrobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ wrapperdescr_raw_call(PyWrapperDescrObject *descr, PyObject *self,
346346
wrapperfunc wrapper = descr->d_base->wrapper;
347347

348348
if (descr->d_base->flags & PyWrapperFlag_KEYWORDS) {
349-
wrapperfunc_kwds wk = (wrapperfunc_kwds)wrapper;
349+
wrapperfunc_kwds wk = (wrapperfunc_kwds)(void(*)(void))wrapper;
350350
return (*wk)(self, args, descr->d_wrapped, kwds);
351351
}
352352

Objects/typeobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6822,7 +6822,7 @@ static slotdef slotdefs[] = {
68226822
"__repr__($self, /)\n--\n\nReturn repr(self)."),
68236823
TPSLOT("__hash__", tp_hash, slot_tp_hash, wrap_hashfunc,
68246824
"__hash__($self, /)\n--\n\nReturn hash(self)."),
6825-
FLSLOT("__call__", tp_call, slot_tp_call, (wrapperfunc)wrap_call,
6825+
FLSLOT("__call__", tp_call, slot_tp_call, (wrapperfunc)(void(*)(void))wrap_call,
68266826
"__call__($self, /, *args, **kwargs)\n--\n\nCall self as a function.",
68276827
PyWrapperFlag_KEYWORDS),
68286828
TPSLOT("__str__", tp_str, slot_tp_str, wrap_unaryfunc,
@@ -6858,7 +6858,7 @@ static slotdef slotdefs[] = {
68586858
TPSLOT("__delete__", tp_descr_set, slot_tp_descr_set,
68596859
wrap_descr_delete,
68606860
"__delete__($self, instance, /)\n--\n\nDelete an attribute of instance."),
6861-
FLSLOT("__init__", tp_init, slot_tp_init, (wrapperfunc)wrap_init,
6861+
FLSLOT("__init__", tp_init, slot_tp_init, (wrapperfunc)(void(*)(void))wrap_init,
68626862
"__init__($self, /, *args, **kwargs)\n--\n\n"
68636863
"Initialize self. See help(type(self)) for accurate signature.",
68646864
PyWrapperFlag_KEYWORDS),

0 commit comments

Comments
 (0)