Hi,

I am in the progress of porting a program to StrongARM, and has encounter the
following error. This simple error give us a big headache to trace it down.

consider this simple program:
int
main(void)
{
    char i = -1;
    printf("%d\n", i);
    return 0;
}

The print out is 255 in stead of -1, unless I define i as
signed char i;
then I get the "-1" print out.

I know the compiler is free to implement char as signed or unsigned or "pseudo
unsigned" according to the standard. But as gcc is treating char as signed char
for other platforms, I wonder is this a special treatment for StronARM? Is it a
bug in GCC? Or my assumsion of gcc will treat char as signed for all platform is
simply wrong. Should it behaves consistently across platforms?

I am using the pre-build cross compiler from LART projects.

-- 
 (~._.~)  �� Ⱥ Ӣ  (Qun Ying)         (65) 874-6743
  ( O )         Kent Ridge Digital Labs (KRDL)
 ()~*~()  21 Heng Mui Keng Terrace, Singapore 119613
 (_)-(_)    [EMAIL PROTECTED]  *  [EMAIL PROTECTED]

unsubscribe: body of `unsubscribe linux-arm' to [EMAIL PROTECTED]
++        Please use [EMAIL PROTECTED] for           ++
++                        kernel-related discussions.                      ++

Reply via email to