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

Function type mismatch #157

Closed
skaller opened this issue Sep 29, 2020 · 4 comments
Closed

Function type mismatch #157

skaller opened this issue Sep 29, 2020 · 4 comments
Assignees

Comments

@skaller
Copy link
Member

skaller commented Sep 29, 2020

Felix currently translates RO and WO pointers to plain RW pointers in some lowering routine so the back end only has to deal with one kind of pointer. Normally we hack all pointers to non-const. However, this fails when the type is part of a function signature, which are not forgiving. In particular an expected C type like

void (*)(int const*)

will not match a felix generated type

void (*)(int *)

This can be fixed by allowing RO pointers to get through to the back end, and handling stuff there.

@skaller skaller self-assigned this Sep 29, 2020
@gchilds
Copy link

gchilds commented Sep 29, 2020

Could you cast the function pointer?

@skaller
Copy link
Member Author

skaller commented Sep 29, 2020

Yes, I have done that. I'm working on getting Felix callback machinery operating. It needs a cast too.

@skaller
Copy link
Member Author

skaller commented Sep 30, 2020

Solution: Based on Felix "kitchen sink(1)" philosophy the answer is to add to the "bag of tricks(2)".

Provide both.

In detail, provide two overloaded callback thunks, one with a signature for Felix use and one for C.

@skaller
Copy link
Member Author

skaller commented Oct 1, 2020

The original Issue should be fixed now.

@skaller skaller closed this as completed in aee822a Oct 1, 2020
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