-
Notifications
You must be signed in to change notification settings - Fork 25
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
Dealing with NULL-able function pointers #30
Comments
Yep this seems like a good course of action, thanks. It's gonna take a bit of work so I can't promise I'll have a fix out as quickly as last time though. |
No worries. I love that this project exists; thanks for making it! I figured this one would be a bit more work. :) |
FWIW, I've added support for this in kinetiknz@bb819e5. I assume @Sean1708 won't want to merge it because rusty-cheddar is being replaced with rusty-binder, but we (https://github.com/mozilla/mp4parse-rust) need this to fix a UB bug (rust-lang/rust#40913), so I went ahead and hacked something up. |
We could still benefit from deploying this fix while rusty-binder is under development. @Sean1708, if you're not interested in merging, would you be willing to add one of us to https://crates.io/crates/rusty-cheddar so we can make releases in the meantime? |
If I declare the following struct in Rust:
rusty-cheddar (correctly) generates this in its header:
C code is able to set bar to
NULL
, but on the Rust side, there's no way to check for that. It appears the expected way of handling this (see here or here) is to change the type on the Rust side to an Option:but rusty-cheddar does not handle this appropriately.
The text was updated successfully, but these errors were encountered: