From d0ea9f0aa270f9791df42eb409e90c718575ad9a Mon Sep 17 00:00:00 2001 From: Nathan Sidwell Date: Mon, 5 Dec 2016 12:24:39 +0000 Subject: diagnostic.c (diagnostic_check_max_errors): New, broken out of ... gcc/ * diagnostic.c (diagnostic_check_max_errors): New, broken out of ... (diagnostic_action_after_output): ... here. (diagnostic_report_diagnostic): Call it for non-notes. * diagnostic.h (struct diagnostic_context): Make max_errors signed int. (diagnostic_check_max_errors): Declare. gcc/fortran/ * error.c (gfc_warning_check): Call diagnostic_check_max_errors. (gfc_error_check): Likewise. gcc/testsuite/ * c-c++-common/fmax_errors.c: Check notes after last error are emitted. From-SVN: r243254 --- gcc/diagnostic.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/diagnostic.h') diff --git a/gcc/diagnostic.h b/gcc/diagnostic.h index ead4d2a..f3bb494 100644 --- a/gcc/diagnostic.h +++ b/gcc/diagnostic.h @@ -143,7 +143,7 @@ struct diagnostic_context bool dc_warn_system_headers; /* Maximum number of errors to report. */ - unsigned int max_errors; + int max_errors; /* This function is called before any message is printed out. It is responsible for preparing message prefix and such. For example, it @@ -320,6 +320,7 @@ void default_diagnostic_start_span_fn (diagnostic_context *, void default_diagnostic_finalizer (diagnostic_context *, diagnostic_info *); void diagnostic_set_caret_max_width (diagnostic_context *context, int value); void diagnostic_action_after_output (diagnostic_context *, diagnostic_t); +void diagnostic_check_max_errors (diagnostic_context *, bool flush = false); void diagnostic_file_cache_fini (void); -- cgit v1.1