Re: INT_MIN and compiler diagnostic
- From: richard@xxxxxxxxxxxxxxx (Richard Tobin)
- Date: 28 Feb 2007 16:07:08 GMT
In article <1172676891.968236.185190@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
bytebro <keith.willis@xxxxxxxxx> wrote:
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)
According to the OP, on his system INT_MIN is defined as
# define INT_MIN (-INT_MAX - 1)
which produces the same result, but does not involve the literal 2147483648.
This seems to be a common trick; on my Mac it is defined as (-0x7fffffff - 1).
-- Richard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
.
- 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: How To Implement Timer in C
- Previous by thread: Re: INT_MIN and compiler diagnostic
- Next by thread: Re: INT_MIN and compiler diagnostic
- Index(es):
Relevant Pages
|