This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Bogus warning?


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]