This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
inapropriate 'comparison is always false due to limited range of data type' warning
- From: "Rodolfo Hansen" <kryptt at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 29 Sep 2006 10:55:27 -0400
- Subject: inapropriate 'comparison is always false due to limited range of data type' warning
Hello,
v857829@vdsdr-125 ~ $ gcc -O0 test.c -o test
test.c: In function 'main':
test.c:5: warning: comparison is always false due to limited range of data type
does not make sense to me in the following code:
#include <stdio.h>
int main (char *argv[], int argc) {
unsigned short int number;
for (number=0; number < ~(number&(~number)) ; number++) {
printf("hello");
}
return 0;
}
i believe gcc is misinterpreting ~(number&(~number))
any coments, help welcome.