+
+/* Remove whitespace in `s' by moving up characters until the end.
+ Return a new string. */
+
+static const char *
+strip_whitespace (const char *s)
+{
+ char *p, *q;
+ char ch;
+
+ if (s == 0)
+ return 0;
+
+ p = q = xmalloc (strlen (s) + 1);
+ while ((ch = *s++) != '\0')
+ if (! ISSPACE (ch))
+ *p++ = ch;
+
+ *p = '\0';
+ return q;
+}
+
+/* Verify that DEFAULT_CONSTRAINT_LEN is used properly and not
+ tampered with. This isn't bullet-proof, but it should catch
+ most genuine mistakes. */
+static void
+check_constraint_len (void)
+{
+ const char *p;
+ int d;
+
+ for (p = ",#*+=&%!1234567890"; *p; p++)
+ for (d = -9; d < 9; d++)
+ if (constraint_len (p, d) != d)
+ abort ();
+}
+
+static int
+constraint_len (const char *p, int genoutput_default_constraint_len)
+{
+ /* Check that we still match defaults.h . First we do a generation-time
+ check that fails if the value is not the expected one... */
+ if (DEFAULT_CONSTRAINT_LEN (*p, p) != 1)
+ abort ();
+ /* And now a compile-time check that should give a diagnostic if the
+ definition doesn't exactly match. */
+#define DEFAULT_CONSTRAINT_LEN(C,STR) 1
+ /* Now re-define DEFAULT_CONSTRAINT_LEN so that we can verify it is
+ being used. */
+#undef DEFAULT_CONSTRAINT_LEN
+#define DEFAULT_CONSTRAINT_LEN(C,STR) \
+ ((C) != *p || STR != p ? -1 : genoutput_default_constraint_len)
+ return CONSTRAINT_LEN (*p, p);
+ /* And set it back. */
+#undef DEFAULT_CONSTRAINT_LEN
+#define DEFAULT_CONSTRAINT_LEN(C,STR) 1
+}