Skip to content

incompatible function pointer types in src/6model/containers.c on Android #1752

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

Open
bduggan opened this issue May 22, 2023 · 1 comment
Open

Comments

@bduggan
Copy link

bduggan commented May 22, 2023

Hello,

When compiling moarVM on android (in termux), following the instructions at https://borg.moe/building-rakudo-perl-6-on-termux.html, I get the error below:

src/6model/containers.c:117:5: error: incompatible function pointer types initializing 'void (*)(MVMThreadContext *, MVMObject *, MVMuint64)' (aka 'void (*)(struct MVMThreadContext *, struct MVMObject *, unsigned long)') with an expression of type 'void (MVMThreadContext *, MVMObject *, MVMint64)' (aka 'void (struct MVMThreadContext *, struct MVMObject *, long)') [-Wincompatible-function-pointer-types]
    code_pair_store_i, /* FIXME need a code_pair_store_u but lacking tests showing this need */
    ^~~~~~~~~~~~~~~~~
src/6model/containers.c:374:5: error: incompatible function pointer types initializing 'void (*)(MVMThreadContext *, MVMObject *, MVMuint64)' (aka 'void (*)(struct MVMThreadContext *, struct MVMObject *, unsigned long)') with an expression of type 'void (MVMThreadContext *, MVMObject *, MVMint64)' (aka 'void (struct MVMThreadContext *, struct MVMObject *, long)') [-Wincompatible-function-pointer-types]
    value_desc_cont_store_i, /* FIXME need a value_desc_cont_store_u but lacking tests showing this need */
    ^~~~~~~~~~~~~~~~~~~~~~~
2 warnings and 2 errors generated.
make: *** [Makefile:668: src/6model/containers.o] Error 1

I was able to work around these errors and get the compilation to succeed by replacing value_desc_cont_store_i with NULL (and ditto for code_pair_store_i) but I think probably there's a better fix

thanks
Brian

@niner
Copy link
Contributor

niner commented May 22, 2023

The real fix is just adding a type cast. There's nothing wrong with the code there. It's just a warning that some settings exaggerate into an error.

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

No branches or pull requests

2 participants