Bogus warning?
Brad Lucier
lucier@math.purdue.edu
Tue Jun 20 09:58:00 GMT 2000
On this file:
#include <stdio.h>
void
test(unsigned long x)
{
if (((unsigned long)(x)<(unsigned int)( (((long)1<<((8*(1<<3))-2-1))-1)+1)))
printf("OK.\n");
else
printf("OK, too.\n");
}
I get:
popov-2% gcc -v
Reading specs from /export/u10/egcs-test/lib/gcc-lib/alphaev6-unknown-linux-gnu/2.96/specs
gcc version 2.96 20000617 (experimental)
popov-4% gcc -W -Wall -c test1.c
test1.c: In function `test':
test1.c:6: warning: comparison of unsigned expression < 0 is always false
As far as I can tell, the right hand side is not zero on the alpha.
Brad Lucier
More information about the Gcc-bugs
mailing list