ppc_8xx-gcc from eldk strange behaviour
Ricardo Scop
rscop at matrix.com.br
Wed Aug 29 14:50:46 EST 2007
Hi, Antonio
On Tuesday 28 August 2007 15:56, DI BACCO ANTONIO - technolabs wrote:
> Consider the following C code snippet:
[snip]
> char x = -4;
[snip]
>
> If I compile it with host gcc, there is no warning and the message "x is
> negative" is printed. If I compile it with ppc_8xx-gcc there is a warning
> "main.c:11: warning: comparison is always false due to limited range of
> data type" and the program prints message "x is positive". To correct the
> problem I have to put signed before char.
>
You can also use the -fsigned-char compilation flag, in this case.
--
Ricardo Scop.
More information about the Linuxppc-embedded
mailing list