This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/14611] static unsigned int small= -1U;
- From: "ierdnah at go dot ro" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Mar 2004 11:46:59 -0000
- Subject: [Bug c/14611] static unsigned int small= -1U;
- References: <20040316192946.14611.ierdnah@go.ro>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From ierdnah at go dot ro 2004-03-17 11:46 -------
ok, i understand, but why "small" isn't modified then, strange:
-----------
#define big 6
unsigned int small=-1;
if( small >= big ) printf("This sholdn't print!");
printf("\n%d",small);
printf("\n%x",small);
-----------
output:This sholdn't print!
-1
ffffffff -> because %x is unsigned
%d -> Signed decimal integer
%x -> Unsigned hexadecimal integer
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14611