Re: INT_MIN and compiler diagnostic
- From: "bytebro" <keith.willis@xxxxxxxxx>
- Date: 28 Feb 2007 05:21:16 -0800
On 28 Feb, 12:34, pete <pfil...@xxxxxxxxxxxxxx> wrote:
bytebro wrote:
INT_MAX = 2147483647 INT_MIN = -2147483648
x = -2147483648 y = -2147483648
So amusingly, it tells me the constant is unsigned, then prints it
signed.
Where's a language lawyer when you need one?!
If INT_MAX equals 2147483647,
the the type of 2147483648 can't be type int, can it?
Erm... it doesn't say "2147483648", it says "-2147483648", which is
exactly equal to INT_MIN, and is therefore a valid int value. The
warning is therefore misleading, no?
.
- Follow-Ups:
- Re: INT_MIN and compiler diagnostic
- From: *** T. Winter
- Re: INT_MIN and compiler diagnostic
- From: Chris Dollin
- Re: INT_MIN and compiler diagnostic
- References:
- Re: INT_MIN and compiler diagnostic
- From: bytebro
- Re: INT_MIN and compiler diagnostic
- From: pete
- Re: INT_MIN and compiler diagnostic
- Prev by Date: Re: INT_MIN and compiler diagnostic
- Next by Date: Re: could you help me about this problem?
- Previous by thread: Re: INT_MIN and compiler diagnostic
- Next by thread: Re: INT_MIN and compiler diagnostic
- Index(es):