Skip to content

Commit 1659c08

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. (cherry picked from commit 1c60715) Co-authored-by: Serhiy Storchaka <[email protected]>
1 parent 7eeab87 commit 1659c08

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
@@ -344,7 +344,7 @@ wrapperdescr_raw_call(PyWrapperDescrObject *descr, PyObject *self,
344344
wrapperfunc wrapper = descr->d_base->wrapper;
345345

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

Objects/typeobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6794,7 +6794,7 @@ static slotdef slotdefs[] = {
67946794
"__repr__($self, /)\n--\n\nReturn repr(self)."),
67956795
TPSLOT("__hash__", tp_hash, slot_tp_hash, wrap_hashfunc,
67966796
"__hash__($self, /)\n--\n\nReturn hash(self)."),
6797-
FLSLOT("__call__", tp_call, slot_tp_call, (wrapperfunc)wrap_call,
6797+
FLSLOT("__call__", tp_call, slot_tp_call, (wrapperfunc)(void(*)(void))wrap_call,
67986798
"__call__($self, /, *args, **kwargs)\n--\n\nCall self as a function.",
67996799
PyWrapperFlag_KEYWORDS),
68006800
TPSLOT("__str__", tp_str, slot_tp_str, wrap_unaryfunc,
@@ -6830,7 +6830,7 @@ static slotdef slotdefs[] = {
68306830
TPSLOT("__delete__", tp_descr_set, slot_tp_descr_set,
68316831
wrap_descr_delete,
68326832
"__delete__($self, instance, /)\n--\n\nDelete an attribute of instance."),
6833-
FLSLOT("__init__", tp_init, slot_tp_init, (wrapperfunc)wrap_init,
6833+
FLSLOT("__init__", tp_init, slot_tp_init, (wrapperfunc)(void(*)(void))wrap_init,
68346834
"__init__($self, /, *args, **kwargs)\n--\n\n"
68356835
"Initialize self. See help(type(self)) for accurate signature.",
68366836
PyWrapperFlag_KEYWORDS),

0 commit comments

Comments
 (0)