Re: INT_MIN and compiler diagnostic



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?

--
pete
.



Relevant Pages

  • Re: INT_MIN and compiler diagnostic
    ... bytebro wrote: ... the the type of 2147483648 can't be type int, ... and is therefore a valid int value. ... Chris "electric hedgehog" Dollin ...
    (comp.lang.c)
  • Re: Arithmetic and C
    ... Massimiliano Alberti wrote: ... >> If two unsigned short values are converted to type int, ... >> then the sum of those two int values, ... CHAR_BIT equals 16 ...
    (comp.lang.c)