egcs-2.91-66 generates the following warning on this code: [root@chameleon Linux]# gcc -o foo foo.c foo.c: In function `main': foo.c:6: warning: comparison is always 0 due to limited range of data type int main(int argc, char **argv) { int rc = 0; char c = 0xa5, *ptr=&c; if (*ptr == 0xa5) rc = 1; /* This is the line that generates the warning */ return rc; }
signed char ranges from -127 to 127 (or so). Hence, a signed char cannot be 0xa5. An unsigned char could be.