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]

Re: decimal integer constant is so large that it is unsigned




BTW,

  This code works:

   if I use hex notation.

   unsigned long x = 0xffffffffu + 1293; 

This compiles and runs great!!#$!@#$ 

Hany

--- Nathan Sidwell <nathan@codesourcery.com> wrote:
> Hany Morcos wrote:
> >  void main()
> > {
> > 
> >   unsigned long  x =  4294967300;
> > 
> > }
> 
> > ct.cpp: In function `int main(...)':
> > ct.cpp:6: integer constant out of range
> > ct.cpp:6: warning: decimal integer constant is so
> > large that it is unsigned
> This is what you would expect where int is a 32bit
> type.
> 4294967300 is too large to be represented, hence the
> error
> 
> nathan
> 
> -- 
> Dr Nathan Sidwell   ::   http://www.codesourcery.com
>   ::   CodeSourcery LLC
>          'But that's a lie.' - 'Yes it is. What's
> your point?'
> nathan@codesourcery.com :
> http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
> 
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

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