This is the mail archive of the gcc@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: Is this warning valid?


"H.J. Lu" wrote:

> Hi,
>
> # gcc -c x.c
> x.c:1: warning: decimal constant is so large that it is unsigned
>
> Why does gcc complain this? Does gcc think
>
>         -2147483648 != (-2147483647 -1)

The catch is that the `-' isn't part of the literal. The compiler
doesn't see `(-2147483648)', it sees `-(2147483648)'. AFAIK this is
correct WRT the standard.

    Brane

--
Branko Cibej   <branko.cibej@hermes.si>
HERMES SoftLab, Litijska 51, 1000 Ljubljana, Slovenia
phone: (++386 61) 186 53 49  fax: (++386 61) 186 52 70




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