[Warning] comparison is always false due to limited range of data type
Hi there!
Really, really strange, I have no clue why I get two warnings. Look at the code yourself, I splitted the lines to see where exactly the compiler (gcc) shouts:
Code:
int func(char *buf)
{
...
if(buf[i] == 0xaf
&& buf[i+1] == 0x00)
if(buf[i+2] == 0x09
&& buf[i+3] == 0x00
&& buf[i+4] == 0x01
&& buf[i+5] == 0x00
&& buf[i+6] == 0xb0
&& buf[i+7] == 0x00
&& buf[i+38] == 0x01
&& buf[i+39] == 0x00)
...
}
Only these two lines get the warning! I mean... does the compiler know the values under race conditions already before? :D:D:D