Mail Archives: djgpp/1996/04/23/11:11:17
>> 2-Why this problem exists? Why doing (-2147483647L-1L) does not produce
>> the same problem?
the string "-2147483648L" is interpreted by the compiler's lexical analyser as
two tokens: a negation operator ("-") and a number ("2147483648L") this causes
an overflow in the parsing stage because 2147483648 is not a long. The problem
is solved with the definition used in limits.h.
>> 3-Why DJGPP defines
>> #define SHRT_MIN (-32768)
>> and BC++4.52 defines
>> #define SHRT_MIN (-32767-1)
>> even for 32 bit applications?
Perhaps BC considers -32768 an int because it is actually an expression: "-"
"32768". Once again, 32768 is not a short, but an int. I suspect it really
doesn't matter, and that Borland used its definition solely for consistency
with the other definitions.
- Raw text -