* diagnostic.c (finish_abort): New fn.
(fancy_abort, error_recursion): Use it.
* toplev.c (crash_signal): Likewise.
* diagnostic.h: Declare it.
* typeck2.c (friendly_abort): Uncount the error before handing
off to fancy_abort.
From-SVN: r37480
+2000-11-15 Jason Merrill <jason@redhat.com>
+
+ * diagnostic.c (finish_abort): New fn.
+ (fancy_abort, error_recursion): Use it.
+ * toplev.c (crash_signal): Likewise.
+ * diagnostic.h: Declare it.
+
2000-11-13 Andrew Haley <aph@redhat.com>
* tree.c (build_type_no_quals): New function.
2000-11-13 Neil Booth <neilb@earthling.net>
- * cpplex.c (_cpp_lex_token): CPP_COMMENT and true CPP_EOF
- cases return without MI check.
- * cpplib.c (do_diagnostic): Take boolean of whether to
- print the directive name.
- (do_error, do_warning): Update.
- (do_pragma_dependency): Use it.
- * cpplib.h (VARARGS_FIRST): Delete.
- (struct cpp_token): Delete integer.
- * cppmacro.c (enter_macro_context): Move disabled check
- to _cpp_get_token.
- (_cpp_get_token): Simplify into a single loop.
+ * cpplex.c (_cpp_lex_token): CPP_COMMENT and true CPP_EOF
+ cases return without MI check.
+ * cpplib.c (do_diagnostic): Take boolean of whether to
+ print the directive name.
+ (do_error, do_warning): Update.
+ (do_pragma_dependency): Use it.
+ * cpplib.h (VARARGS_FIRST): Delete.
+ (struct cpp_token): Delete integer.
+ * cppmacro.c (enter_macro_context): Move disabled check
+ to _cpp_get_token.
+ (_cpp_get_token): Simplify into a single loop.
2000-11-13 Richard Earnshaw <rearnsha@arm.com>
+2000-11-15 Jason Merrill <jason@redhat.com>
+
+ * typeck2.c (friendly_abort): Uncount the error before handing
+ off to fancy_abort.
+
2000-11-15 Nathan Sidwell <nathan@codesourcery.com>
* typeck.c (lookup_anon_field): Cope with qv qualifiers.
if (where > 0)
error ("Internal error #%d.", where);
+ /* Uncount this error, so finish_abort will do the right thing. */
+ --errorcount;
+
fancy_abort (file, line, func);
}
finish_diagnostic ();
fprintf (stderr,
-"Internal compiler error: Error reporting routines re-entered.\n\
-Please submit a full bug report.\n\
-See %s for instructions.\n", GCCBUGURL);
-
- exit (FATAL_EXIT_CODE);
+ "Internal compiler error: Error reporting routines re-entered.");
+ finish_abort ();
}
/* Given a partial pathname as input, return another pathname that
int line;
const char *function;
{
- fatal (
-"Internal compiler error in %s, at %s:%d\n\
+ error ("Internal compiler error in %s, at %s:%d",
+ function, trim_filename (file), line);
+ finish_abort ();
+}
+
+/* Finish reporting an internal compiler error. If the only error we've
+ seen is the current one, encourage the user to file a bug report;
+ otherwise, fixing their code will probably avoid the crash. */
+
+void
+finish_abort ()
+{
+ if (errorcount > 1 || sorrycount > 0)
+ fprintf (stderr, "confused by earlier errors, bailing out\n");
+ else
+ fprintf (stderr, "\
Please submit a full bug report.\n\
-See %s for instructions.",
- function, trim_filename (file), line, GCCBUGURL);
+See %s for instructions.\n",
+ GCCBUGURL);
+
+ exit (FATAL_EXIT_CODE);
}
/* Setup DC for reporting a diagnostic MESSAGE (an error of a WARNING),
int error_function_changed PARAMS ((void));
void record_last_error_function PARAMS ((void));
void report_problematic_module PARAMS ((output_buffer *));
+void finish_abort PARAMS ((void)) ATTRIBUTE_NORETURN;
#endif /* __GCC_DIAGNOSTIC_H__ */
/* If this is missing, some compilers complain. */
int signo;
{
- fatal ("Internal error: %s.\n\
-Please submit a full bug report.\n\
-See %s for instructions.", strsignal (signo), GCCBUGURL);
+ error ("Internal error: %s.", strsignal (signo));
+ finish_abort ();
}
/* Strip off a legitimate source ending from the input string NAME of