This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: decimal integer constant is so large that it is unsigned
- To: Nathan Sidwell <nathan at codesourcery dot com>
- Subject: Re: decimal integer constant is so large that it is unsigned
- From: Hany Morcos <hanymorcos at yahoo dot com>
- Date: Tue, 14 Mar 2000 07:01:45 -0800 (PST)
- Cc: gcc-bugs at gcc dot gnu dot org
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