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

Request - provide a C function pointer type #725

Open
vimirage opened this issue Jul 24, 2022 · 3 comments
Open

Request - provide a C function pointer type #725

vimirage opened this issue Jul 24, 2022 · 3 comments
Labels
RFE Request For Enhancement

Comments

@vimirage
Copy link

vimirage commented Jul 24, 2022

Problems Description

Upstream issues: denoland/deno#15292(, tov/libffi-rs#57).

The only reference to using pointers in function signatures that I found was as follows:

ffi_type_pointer
A generic void * pointer. You should use this for all
pointers, regardless of their real type.

The problem with this is that as void * is a data pointer, it is not suitable for usage as a function pointer.
See https://c-faq.com/ptrs/generic.html.

The request is that a separate ffi_function_pointer is provided, mapping to C's void(*)().

@atgreen atgreen added the RFE Request For Enhancement label Jul 26, 2022
@atgreen
Copy link
Member

atgreen commented Jul 26, 2022

Fair point. What platforms is this a real problem on?

@vimirage
Copy link
Author

vimirage commented Jul 26, 2022

We have not encountered any platform yet that actually incur such breakage/mismatch - at the moment, it's primarily a "technically this should be avoided" by the specification, situation.

If the lack of "realism" is not a deal-breaker, would the project be open to any commits adding such a feature?

@atgreen
Copy link
Member

atgreen commented Jul 26, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFE Request For Enhancement
Projects
None yet
Development

No branches or pull requests

2 participants