Issue 33454: Mismatched C function signature in _xxsubinterpreters.channel_close() (original) (raw)
The C function that implements _xxsubinterpreters.channel_close() is defined with the signature
PyObject *channel_close(PyObject *self, PyObject *args, PyObject *kwds)
which corresponds the method convention METH_VARARGS | METH_KEYWORDS, but is used with the incompatible method convention METH_VARARGS. Either the signature or flags are not correct.
Actually it can use just METH_O. The proposed PR changes both signature and flags and simplifies the implementation.
The bug was found thanks to gcc 8 emitting a warning for invalid function cast (it also emits a lot of false alarms). See also .