-
2147483648 provokes warnings, for various reasons involving the
definition of a constant in C, the rules of picking the type of a
constant, and the rules for determining the type of an expression
involving an integral value and the - operator. (Note that
-2147483648isn't a decimal-constant in C90 or C99, as a decimal-constant
can't contain a -. Therefore, it's a constant expression, consisting of
the - operator applied to the constant
2147483648.)
So we use INT32_MIN, which should at least make an effort to avoid those
warnings.
{
if (secs < 0) {
ND_PRINT((ndo, "-"));
- if (secs == -2147483648) {
+ if (secs == INT32_MIN) {
/*
* -2^31; you can't fit its absolute value into
* a 32-bit signed integer.