<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7235.2">
<TITLE>ppc_8xx-gcc from eldk strange behaviour</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->

<P><FONT SIZE=2>Consider the following C code snippet:<BR>
<BR>
#include &lt;stdio.h&gt;<BR>
<BR>
int main()<BR>
{<BR>
&nbsp; char x = -4;<BR>
&nbsp;&nbsp;&nbsp;<BR>
&nbsp; if (x &lt; 0)<BR>
&nbsp;&nbsp;&nbsp; printf(&quot;x is negative\n&quot;);<BR>
&nbsp; else<BR>
&nbsp;&nbsp;&nbsp; printf(&quot;x is positive\n&quot;);&nbsp;<BR>
}<BR>
<BR>
If I compile it with host gcc, there is no warning and the message &quot;x is negative&quot; is printed.<BR>
If I compile it with ppc_8xx-gcc there is a warning &quot;main.c:11: warning: comparison is always false due to limited range of data type&quot; and the program prints message &quot;x is positive&quot;.<BR>
To correct the problem I have to put signed before char.<BR>
<BR>
Bye,<BR>
Antonio.</FONT>
</P>

</BODY>
</HTML>