Gcc/g++ bug report: decimal constant too large

Alexandre Oliva aoliva@redhat.com
Fri Aug 31 05:38:00 GMT 2001


On Aug 31, 2001, Tomas Kalibera <tkal6255@ss1000.ms.mff.cuni.cz> wrote:

> The bug being reported is that warning "decimal constant is so large
> that it is unsigned"

GCC is correct.  There's no such thing as a negative literal integral
constant.  You've got two tokens, the negation operator and the
2147483648 constant, that doesn't fit in a signed integer, so GCC
reports the problem.

> is issued by gcc for integer constant - 2^31 - 1
> (-2147483648),
> although it is a valid integer constant (because it equals to INT_MIN from
> limits.h).

Guess why INT_MIN is defined as (-2147483647-1) :-)

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me



More information about the Gcc-bugs mailing list