+/* Sanity-checks are dependent on command-line options, so it is
+ called as a subroutine of cpp_post_options (). */
+#if ENABLE_CHECKING
+static void sanity_checks PARAMS ((cpp_reader *));
+static void sanity_checks (pfile)
+ cpp_reader *pfile;
+{
+ cppchar_t test = 0;
+ size_t max_prec;
+
+ /* Sanity checks for CPP arithmetic. */
+ test--;
+ if (test < 1)
+ cpp_error (pfile, DL_FATAL, "cppchar_t must be an unsigned type");
+
+ if (CPP_OPTION (pfile, precision) > BITS_PER_HOST_WIDEST_INT)
+ cpp_error (pfile, DL_FATAL,
+ "preprocessor arithmetic has maximum precision of %u bits; target requires %u bits",
+ BITS_PER_HOST_WIDEST_INT, CPP_OPTION (pfile, precision));
+
+ max_prec = CPP_OPTION (pfile, char_precision);
+ if (max_prec < CPP_OPTION (pfile, wchar_precision))
+ max_prec = CPP_OPTION (pfile, wchar_precision);
+ if (max_prec > BITS_PER_CPPCHAR_T)
+ cpp_error (pfile, DL_FATAL,
+ "CPP on this host cannot handle (wide) character constants over %u bits, but the target requires %u bits",
+ BITS_PER_CPPCHAR_T, max_prec);
+}
+#else
+# define sanity_checks(PFILE)
+#endif
+