Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lru: Use PyCFunction instead of PyCFunctionWithKeywords
PyMethodDef uses PyMethodDef and not PyCFunctionWithKeywords and when callback is specified as PyCFunctionWithKeywords, clang 16+ is able to detect function signature mismatch in function pointers now. Fixes lru.c:629:17: error: incompatible function pointer types initializing 'PyCFunction' (aka 'struct _object *(*)(struct _object *, struct _object *)') with an expression of type 'PyCFunctionWithKeywords' (aka 'struct _object *(*)(struct _object *, struct _object *, struct _object *)') [-Wincompatible-function-pointer-types] {"popitem", (PyCFunctionWithKeywords)LRU_popitem, METH_VARARGS | METH_KEYWORDS, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. Signed-off-by: Khem Raj <[email protected]>
- Loading branch information