Re: INT_MIN and compiler diagnostic
- From: "*** T. Winter" <***.Winter@xxxxxx>
- Date: Wed, 28 Feb 2007 15:59:17 GMT
In article <1172676891.968236.185190@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> "bytebro" <keith.willis@xxxxxxxxx> writes:
On 28 Feb, 13:20, Chris Dollin <chris.dol...@xxxxxx> wrote:....
....No.
`-2147483648` isn't a literal constant. It's an expression, the
negation of `2147483648`.
The thing is, in the OP's code lines 7 and 8, it says:
7 int y = -2147483648;
8 int x = INT_MIN;
which are _completely_ equivalent (INT_MIN is _defined_ as
-2147483648), and yet line 7 generates the warning:
Please check it. It will probably defined as (- 2147483647 - 1),
which is something different.
--
*** t. winter, cwi, kruislaan 413, 1098 sj amsterdam, nederland, +31205924131
home: bovenover 215, 1025 jn amsterdam, nederland; http://www.cwi.nl/~***/
.
- References:
- Re: INT_MIN and compiler diagnostic
- From: bytebro
- Re: INT_MIN and compiler diagnostic
- From: Chris Dollin
- Re: INT_MIN and compiler diagnostic
- From: bytebro
- Re: INT_MIN and compiler diagnostic
- Prev by Date: Re: INT_MIN and compiler diagnostic
- Next by Date: Re: INT_MIN and compiler diagnostic
- Previous by thread: Re: INT_MIN and compiler diagnostic
- Next by thread: Re: INT_MIN and compiler diagnostic
- Index(es):