This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
No Compilation Warning...
- From: "Manje Gowda S G" <sakala at linuxmail dot org>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 14 Jun 2004 20:23:06 +0800
- Subject: No Compilation Warning...
Hi,
test.c: In function `main':
test.c:7: warning: comparison is always true due to limited range of data type
I am getting the above warning on compilation of the following code
#include <stdio.h>
int main()
{
unsigned short s;
if (0 <= s) {
printf("Hello Sakala\n");
}
return(0);
}
Ya, warning make sense but if I change "unsigned short s;" to as follows
#include <stdio.h>
int main()
{
unsigned int s;
if (0 <= s) {
printf("Hello Sakala\n");
}
return(0);
}
then on compilation, (if I am not wrong...) I am suppose to get the same warning message, but no.
Is this a bug or am I wrong some where? sorry if I am wrong.
I use...,
gcc version 3.3.2 20031022 (Red Hat Linux 3.3.2-1)
Best Regards,
-Manje Gowda
--
______________________________________________
Check out the latest SMS services @ http://www.linuxmail.org
This allows you to send and receive SMS through your mailbox.
Powered by Outblaze