[ELDK] char type is being interpreted as 'unsigned char'

Wolfgang Denk wd at denx.de
Thu Feb 21 14:02:58 CET 2008


In message <22F058C3ED9D784E90CE473F2A9847F0028D1CB9 at in-exchange> you wrote:
> 
> I'm using 'char' data types in my program. On Redhat enterprise
> (2.6.9-55.ELsmp / gcc 3.4.6) it is being interpreted as 'signed char'
> and providing a value range of -128 to +127.
> 
> When I cross compile for ELDK 4.1/PPC 8280 (using ARCH=powerpc /
> CROSS_COMPILE=ppc_6xx-, ppc_6xx-gcc 4.0.0), char is getting interpreted
> as 'unsigned char' and providing a value range of 0 - 255.

Both of this is perfectly legal.

> Is there a way I can make 'char' being interpreted as 'signed char' on
> this ELDK platform?

Declare your variables as "signed char" types.


I have to admit that I consider code that depends on such things to be
broken.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
panic: kernel trap (ignored)


More information about the eldk mailing list