Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python: Changes required in order to build on newer gcc compiler 9.4 #1

Open
wants to merge 5 commits into
base: bits
Choose a base branch
from

Conversation

ani-sinha
Copy link

These are all the changes required to build python on the newer gcc 9.4 compiler

ani-sinha added 3 commits May 31, 2022 14:12
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]>
Fix indentation so as to improve readability.

Signed-off-by: Ani Sinha <[email protected]>
This change is cosmetic and only silences a gcc warning (-Wint-in-bool-context)

Signed-off-by: Ani Sinha <[email protected]>
All changes in this patch tries to address implicit fallthrough warnings on the
newer gcc compiler.

Signed-off-by: Ani Sinha <[email protected]>
Bad confusing indentation was causing build failures under gcc 11.
Fix them.

Signed-off-by: Ani Sinha <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant