c_char signedness doesn't match with Clang's default on various no-std and tier 3 targets #129945
Labels
A-ABI
Area: Concerning the application binary interface (ABI)
C-bug
Category: This is a bug.
O-AArch64
Armv8-A or later processors in AArch64 mode
O-android
Operating system: Android
O-Arm
Target: 32-bit Arm processors (armv6, armv7, thumb...), including 64-bit Arm in AArch32 state
O-bare-metal
Target: Rust without an operating system
O-csky
Target: glaCSKY above covers over me~
O-hermit
Operating System: Hermit
O-illumos
the other shiny OS
O-riscv
Target: RISC-V architecture
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
As an next step of #122985 ("c_char on AIX should be u8"), I checked all builtin targets' c_char (as of nightly-2024-09-03) using the following script.
check_c_char.sh
The result (stdout of the script) is:
stderr of the script (version info, etc.)
Note about the above script (potential false positive / false negative)
m68k-unknown-linux-gnu
: can't compile functions with certain return types #89498) are ignored in the above script. (potential false negative)As stated in the title, there are many
target_os = "none" target
and tier3 targets that do not match.target_os = "none" target
, most of them probably do not match with Clang's default.c_char
was originally defined instd
and this mismatch was missed when it was moved tocore
.c_char
directly on these targets, but this includes a lot of tier 2 targets, so changing this to match Clang could have a not small impact on embedded ecosystem.References:
char
data type is unsigned."@rustbot label +A-abi +O-Arm +O-AArch64 +O-riscv +O-csky +O-bare-metal +O-android +O-illumos +O-hermit
The text was updated successfully, but these errors were encountered: