Thanks Ian. I will raise this in gcc-help mailing list.
Cheers
Hari
Ian Lance Taylor wrote:
Hariharan <[EMAIL PROTECTED]> writes:
I found something rather strange with the unsigned comparison warnings
in GCC.
This is the wrong mailing list. The mailing list gcc@gcc.gnu.org is
for gcc developers. The mailing list [EMAIL PROTECTED] is for
questions about using gcc. Please take any followups to
[EMAIL PROTECTED] Thanks.
and i did gcc -O2 -c trial.c, then i get a warning
trial.c:6: warning: comparison is always true due to limited range of data type
It works the same way if i used an unsigned short. But, if i use
unsigned int/long, i dont get this warning. This is on x86. Is there
an explanation for this?
You neglected to mention the version of gcc. In current gcc, I don't
see any warning when using "gcc -O2 -c trial.c". I see a warning for
both "unsigned char" and "unsigned int" when I add the -Wextra option.
Ian