-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Expose c_int as core::ffi::c_int? #3012
Comments
The C standard does not mandate that enums be represented as an int:
|
Right, on targets with actual C compilers it should match (and in practice Rust currently uses the c_int size specified in the target spec for repr(C) enums, AFAICT anyway). That's just a way forward for deciding the behavior on some hypothetical target that has no C compiler, and thus no c_int |
There have been multiple requests to move the non-system-specific-but-still-target-specific stuff like |
I would love to see most of the basic FFI types moved into |
Tracking issue rust-lang/rust#94501 |
Closing in favor of the tracking issue. |
This is already part of the target specification, and you can observe the size of
c_int
inno_std
programs by examining the size of a#[repr(C)]
enum.If we're worried about future platforms with a Rust compiler and no C compiler, on such a platform it would just be a signed integer the same size as a
#[repr(C)]
enum.The text was updated successfully, but these errors were encountered: