Bogus warning: integer constant too large

Alexandre Oliva oliva@dcc.unicamp.br
Wed Mar 31 23:54:00 GMT 1999


On Mar  1, 1999, "Brad M. Garcia" <bgarcia@fore.com> wrote:

> Here's a little test program to produce the bogus warning:

> long foo1 = (-2147483648); /* produces the warning */

This is not bogus.  `-' and `2147483648' are two separate tokens,
according to the C++ Standard, and the latter overflows an int (and a
long, for that matter).

-- 
Alexandre Oliva http://www.dcc.unicamp.br/~oliva aoliva@{acm.org,computer.org}
oliva@{dcc.unicamp.br,gnu.org,egcs.cygnus.com,samba.org}
Instituto de Computação, Universidade Estadual de Campinas, SP, Brasil




More information about the Gcc-bugs mailing list