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

bits: changes required in order to build on a newer gcc compiler 9.4 #13

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ani-sinha
Copy link

These are all the changes needed to build bits on the newer gcc 9.4 compiler.

ani-sinha added 3 commits May 31, 2022 14:20
Indentation for an if condition was incorrect. Hence upon hitting the error
conditional, the code was not returning the error the value. Fixed in this
change by adding braces with the if conditional. This error was found when
compiling with a newer version of gcc 9.4.0 on ubuntu 20.04.2.

Signed-off-by: Ani Sinha <[email protected]>
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]>
All the bits specific submodules have been forked and this commit updates the
top level bits repo to refer to these forks.

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