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: Hany Morcos <hanymorcos at yahoo dot com>
- Subject: Re: decimal integer constant is so large that it is unsigned
- From: Nathan Sidwell <nathan at codesourcery dot com>
- Date: Tue, 14 Mar 2000 14:51:02 +0000
- CC: gcc-bugs at gcc dot gnu dot org
- Organization: CodeSourcery, LLC
- References: <20000314142042.2908.qmail@web3207.mail.yahoo.com>
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