<!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 <stdio.h><BR>
<BR>
int main()<BR>
{<BR>
char x = -4;<BR>
<BR>
if (x < 0)<BR>
printf("x is negative\n");<BR>
else<BR>
printf("x is positive\n"); <BR>
}<BR>
<BR>
If I compile it with host gcc, there is no warning and the message "x is negative" is printed.<BR>
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".<BR>
To correct the problem I have to put signed before char.<BR>
<BR>
Bye,<BR>
Antonio.</FONT>
</P>
</BODY>
</HTML>