This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/14611] static unsigned int small= -1U;


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]