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: "zack at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Mar 2004 11:32:15 -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 zack at codesourcery dot com 2004-03-17 11:32 -------
Subject: Re: static unsigned int small= -1U;
"ierdnah at go dot ro" <gcc-bugzilla@gcc.gnu.org> writes:
> #define big 6
> unsigned int small=-1;
Think of "unsigned" as meaning "always greater than or equal to zero."
On all platforms supported by GCC, assigning the value -1 to an
unsigned int causes it to be converted to the value UINT_MAX. This is
the largest number that can fit in an unsigned int. The C standard
requires this number to be at least 65535, which is (obviously)
greater than 6.
zw
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14611