-
Notifications
You must be signed in to change notification settings - Fork 723
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
Generating array pointers #1561
Comments
Per IRC discussion, this is patchable, assuming they're equivalent, but it's not 100% clear to me they are, as pointers to slices and array in rust are so weird. |
I really hope they're equivalent, let's see if someone that knows will answer. |
Right now the responses in the forum seems to suggest that this isn't UB, and there's a difference between slices and arrays. |
@emilio The memory structure of the type Source:
|
Yes. This should be pretty easy to patch: rust-bindgen/src/codegen/mod.rs Line 3909 in e5250a0
Probably worth making it configurable, given it's trivial to keep both behaviors. |
how do you want to pass the desired behavior? add an option to the builder? I can give this a try and make a PR |
Yeah, the options should be accessible from there, see similar uses of |
ok, thanks that way it shouldn't even be a breaking change if the default stays the same :) |
Yeah, that's definitely a plus :) |
Input C Header
Bindgen Invocation
Actual Results
Expected Results
I would've want it to produce this code instead:
The text was updated successfully, but these errors were encountered: