Skip to content

Enable size_t_is_usize #2

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

Merged
merged 1 commit into from
Aug 14, 2020
Merged

Conversation

goto-bus-stop
Copy link
Contributor

@goto-bus-stop goto-bus-stop commented Aug 14, 2020

This is a breaking change.

bindgen switched the default output for parameters with the size_t C type to u32/u64 depending on the target platform. Per rust-lang/rust-bindgen#1671, the old behaviour where size_t would just output usize is not technically correct, because the C standard has a slightly different definition for size_t.

AFAIK it is correct for all platforms that Node.js supports though. bindgen added a toggle to opt back in to the old behaviour. Since bindgen had been doing this for years without issue, I think we're safe 🤔

This is a breaking change.
@elmarx
Copy link
Owner

elmarx commented Aug 14, 2020

OK, that makes sense, especially when reading the linked issue. Even https://github.com/fishinabarrel/linux-kernel-module-rust seems to opt for size_t_is_usize

I hope the breaking change is not too painful :/ At least it's pre 1.0 ;)

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

Successfully merging this pull request may close these issues.

2 participants