Commit 6a270722 by Richard Kenner

(have_error): New variable.

(error): Set it.
(main): Test it and return FATAL_EXIT_CODE if it is set.

From-SVN: r2934
parent 6e2a4e3c
...@@ -166,6 +166,11 @@ struct data *end_of_insn_data; ...@@ -166,6 +166,11 @@ struct data *end_of_insn_data;
int have_constraints; int have_constraints;
/* Nonzero if some error has occurred. We will make all errors fatal, but
might as well continue until we see all of them. */
static int have_error;
static void static void
output_prologue () output_prologue ()
{ {
...@@ -919,6 +924,8 @@ error (s, a1, a2) ...@@ -919,6 +924,8 @@ error (s, a1, a2)
fprintf (stderr, "genoutput: "); fprintf (stderr, "genoutput: ");
fprintf (stderr, s, a1, a2); fprintf (stderr, s, a1, a2);
fprintf (stderr, "\n"); fprintf (stderr, "\n");
have_error = 1;
} }
int int
...@@ -973,7 +980,9 @@ main (argc, argv) ...@@ -973,7 +980,9 @@ main (argc, argv)
output_epilogue (); output_epilogue ();
fflush (stdout); fflush (stdout);
exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE); exit (ferror (stdout) != 0 || have_error
? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
/* NOTREACHED */ /* NOTREACHED */
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment