Commit 08dd543
committed
python: do not error out on incompatible function pointer casts
In many cases, the callback function pointers in PyMethodDef definitions are
cast to PyCFunction type where as their actual signature matches that of
PyCFunctionWithKeywords type. This issue exists throughout in python 2.7
codebase in general. On newer compilers, this produces a compile time failure
like the following:
build/grub/grub-core/contrib/python/bitsmodule.c:558:16: error: cast between incompatible function types from 'PyObject * (*)(PyObject *, PyObject *, PyObject *)' {aka 'struct _object * (*)(struct _object *, struct _object *, struct _object *)'} to 'PyObject * (*)(PyObject *, PyObject *)' {aka 'struct _object * (*)(struct _object *, struct _object *)'} [-Werror=cast-function-type]
558 | {"get_xy", (PyCFunction)bits_get_xy, METH_KEYWORDS, "get_xy(term) -> (cursor_x, cursor_y)"},
Pass -Wno-cast-function-type in compiler cflags in order to suppress this
failure.
Signed-off-by: Ani Sinha <[email protected]>1 parent 3cfe27c commit 08dd543
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
0 commit comments