On Wed, Dec 13 2017, Sebastien Marie <sema...@online.fr> wrote:
> First, thanks to all people that answered, off-list or not.
>
> On Tue, Dec 12, 2017 at 10:01:14PM +0100, Jeremie Courreges-Anglas wrote:
>> On Tue, Dec 12 2017, Sebastien Marie <sema...@online.fr> wrote:
>> 
>> [...]
>> 
>> > But I would like confirmation because for all BSD where I have the
>> > information, I always have a signed char (aarch64-freebsd,
>> > powerpc-netbsd, arm-netbsd, ...), except arm64 on OpenBSD.
>> >
>> > Is it expected ?
>> 
>> I would certainly not expect NetBSD and FreeBSD to have "char" signed by
>> default.  afaik the powerpc, arm and arm64 ABIs define "char" as
>> unsigned.
>> 
>> FreeBSD documents those architectures as using unsigned char:
>> 
>>   
>> https://www.freebsd.org/cgi/man.cgi?query=arch&apropos=0&sektion=7&manpath=FreeBSD+12-current&arch=default&format=html
>
> So it means the Rust libc definition for them is currently wrong, as
> 'char' is defined as 'i8' (signed byte) instead of 'u8' (unsigned byte).
> I will report it to FreeBSD people.

Maybe talk with the rust folks too, they probably have made that choice
for Linux on powerpc/arm*.

>> afaik with clang and gcc you can just test whether __CHAR_UNSIGNED__ is
>> defined.
>
> Rust is a wonderfull land where all the standard libc definition has to
> be rewritten by hand (and kept in sync), so I haven't access to such
> compilation variable... </sarcasm>

Have fun. :)

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply via email to