This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: middle-end/6694: Warning that largest negative int -2147483648 in comparison is unsigned
- From: "R. Bernstein" <rocky at panix dot com>
- To: sirl at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org,rocky at panix dot com, gcc-gnats at gcc dot gnu dot org
- Date: Sat, 18 May 2002 14:03:58 -0400
- Subject: Re: middle-end/6694: Warning that largest negative int -2147483648 in comparison is unsigned
- References: <20020517141330.8363.qmail@sources.redhat.com>
- Reply-to: rocky at panix dot com
> State-Changed-Why:
> Not a bug. There are no negative constants in C.
> The constant overflows 'int' (thus the warning) and then the negation is applied as an operation.
I think there would be less confusion then if the warning message were
changed to
warning: positive decimal constant is so large that it is unsigned
^^^^^^^
Or even better
warning: positive decimal constant 2147483648 is so large that it is unsigned
(where 2147483648 is of course substituted in from the offending value).