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


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

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