Closed
Description
While debugging a signed/unsigned char issue I started looking at the list of triples that use unsigned chars by default and it appears the logic in Clang does not match the ABI documents for some architectures. I noticed some issues while comparing isSignedCharDefault() with the Rust list of systems with unsigned char: https://github.com/rust-lang/rust/blob/6503543d11583d1686d4989847b2afbec8d9fdba/library/core/src/ffi/mod.rs#L92
So far it appears s390x, csky, xtensa, msp430 are missing from isSignedCharDefault(), but there might be other omissions.
- csky: https://github.com/c-sky/csky-doc/blob/master/C-SKY_V2_CPU_Applications_Binary_Interface_Standards_Manual.pdf says CSKY should have unsigned char by default
- Misread the clang source, is already correct
s390x: https://github.com/IBM/s390x-abi states the range ofchar
is0 … 2^n − 1
, i.e. it usesunsigned char
- msp430: https://www.ti.com/lit/pdf/slaa534 states
the char type is unsigned by default
, GCC agrees - xtensa: GCC says char is unsigned, not sure where the ABI document is.
I don't see a CSKY GCC on godbolt, but https://godbolt.org/z/qaaW18znY confirms that the other architectures diverge from GCC
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done