#include "config.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "cpplib.h"
#include "cpphash.h"
return CPP_N_INVALID;
}
- /* Traditional C only accepted the 'L' suffix. */
- if (result != CPP_N_SMALL && result != CPP_N_MEDIUM
- && CPP_WTRADITIONAL (pfile)
- && ! cpp_sys_macro_p (pfile))
- cpp_error (pfile, DL_WARNING,
- "traditional C rejects the \"%.*s\" suffix",
- (int) (limit - str), str);
+ /* Traditional C only accepted the 'L' suffix.
+ Suppress warning about 'LL' with -Wno-long-long. */
+ if (CPP_WTRADITIONAL (pfile) && ! cpp_sys_macro_p (pfile))
+ {
+ int u_or_i = (result & (CPP_N_UNSIGNED|CPP_N_IMAGINARY));
+ int large = (result & CPP_N_WIDTH) == CPP_N_LARGE;
+
+ if (u_or_i || (large && CPP_OPTION (pfile, warn_long_long)))
+ cpp_error (pfile, DL_WARNING,
+ "traditional C rejects the \"%.*s\" suffix",
+ (int) (limit - str), str);
+ }
if ((result & CPP_N_WIDTH) == CPP_N_LARGE
&& ! CPP_OPTION (pfile, c99)
"integer constant is too large for its type");
/* If too big to be signed, consider it unsigned. Only warn for
decimal numbers. Traditional numbers were always signed (but
- we still honour an explicit U suffix); but we only have
+ we still honor an explicit U suffix); but we only have
traditional semantics in directives. */
else if (!result.unsignedp
&& !(CPP_OPTION (pfile, traditional)
The remaining cases are '(' and ')'. We handle '(' by skipping the
reduction phase completely. ')' is given lower priority than
everything else, including '(', effectively forcing a reduction of the
-parenthesised expression. If there is a matching '(', the routine
+parenthesized expression. If there is a matching '(', the routine
reduce() exits immediately. If the normal exit route sees a ')', then
there cannot have been a matching '(' and an error message is output.
}
else if (want_value)
{
- /* Ordering here is subtle and intended to favour the
+ /* Ordering here is subtle and intended to favor the
missing parenthesis diagnostics over alternatives. */
if (op.op == CPP_CLOSE_PAREN)
{
result.high += HIGH_PART (middle[0]);
result.high += HIGH_PART (middle[1]);
+ result.unsignedp = 1;
return result;
}
return lhs;
}
- /* First non-zero bit of RHS is bit I. Do naive division by
+ /* First nonzero bit of RHS is bit I. Do naive division by
shifting the RHS fully left, and subtracting from LHS if LHS is
at least as big, and then repeating but with one less shift.
This is not very efficient, but is easy to understand. */