Suppose that on a platform, the minimal signed value is −2^15 = −32768 and the maximum value is 2^15 −1 = 32767. The constant 32768 then doesn’t fit into
signed
and is thussigned long
. As a consequence, the expression -32768 has typesigned long
. Thus the minimal value of the typesigned
on such a platform cannot be written as a literal constant.From Modern C by Jens Gustedt.
It's trivial to understand why 32768 is signed long
, but why is -32768 also signed long
and not signed
, given the minimum signed
value of -32768?