I just noticed this, but:
+static void read_int(const char **line, int *i) +{ + char *rest; + long val; + + errno = 0; + val = strtol(*line, &rest, 0); + + if (errno != 0) + fatal_error("Malformed int constant '%s'.\n", *line); + + *i = val; + if (*i != val) + fatal_error("Out of range int constant '%s'.\n", *line);
Here and to some extent above, I don't think we can just print "*line"; there may be additional data beyond "rest" that we'd also output.
We may also want to make sure "*rest" is either '\0' or a whitespace character.