-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Fix c_char on various no-std and tier 3 targets #131319
Conversation
38245fc
to
f587fe3
Compare
// option is used." | ||
// https://learn.microsoft.com/en-us/cpp/cpp/fundamental-types-cpp?view=msvc-170#character-types) | ||
if #[cfg(all( | ||
not(any(target_vendor = "apple", windows)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not(any(target_vendor = "apple", windows)), | |
not(target_vendor = "apple"), | |
not(windows), |
would be easier to understand IMO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for readability in case there are more “exception targets”.
See rust-lang/libc#4198 (comment) for more.
Expcept for L4RE and Xtensa these were obtained from rust-lang#131319 I could not find an open link to the Xtensa documentation, but the signedness was confirmed by on of the Xtensa developers in llvm/llvm-project#115967 (comment) Co-authored-by: Taiki Endo <te316e89@gmail.com>
This is being superseded by #132975 now |
Rollup merge of rust-lang#132975 - arichardson:ffi-c-char, r=tgross35 De-duplicate and improve definition of core::ffi::c_char Instead of having a list of unsigned char targets for each OS, follow the logic Clang uses and instead set the value based on architecture with a special case for Darwin and Windows operating systems. This makes it easier to support new operating systems targeting Arm/AArch64 without having to modify this config statement for each new OS. The new list does not quite match Clang since I noticed a few bugs in the Clang implementation (llvm/llvm-project#115957). Fixes rust-lang#129945 Closes rust-lang#131319
Fixes #129945
This PR makes c_char match with the Clang's default, except when Clang does not match the ABI's default.
TODO:
not(any(target_os = "none", target_os = "uefi"))
for now to avoid changes, etc.)libc
and release new version of libcr? @ghost
@rustbot label -S-waiting-on-review, +S-waiting-on-author