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

warning: ISO C forbids conversion of function pointer to object pointer type #86

Open
stcmeh opened this issue Nov 24, 2021 · 0 comments

Comments

@stcmeh
Copy link

stcmeh commented Nov 24, 2021

I think that this warning arises because some CPU architectures have different memory bus sizes for code memory and data memory. Your code uses a single pointer to point to either functions or data with a second flag to indicate what the pointer means. The use of a single pointer type (void *) causes the compiler warning.

I tried just doing simple type-casting e.g. on line 161:

{"abs",   (void *)fabs,   TE_FUNCTION1 | TE_FLAG_PURE, 0},

But that didn't work.

Maybe a union would work? Not sure. Or you'd need to have two pointers in te_variable.

As far as I know the code still works but it creates lots of warnings.

Thanks for any help with this.

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

1 participant