diff options
Diffstat (limited to 'gcc/diagnostic.c')
-rw-r--r-- | gcc/diagnostic.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index 729e8654298..4913eed9c67 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -147,6 +147,7 @@ diagnostic_initialize (diagnostic_context *context, int n_opts) context->option_enabled = NULL; context->option_state = NULL; context->option_name = NULL; + context->last_location = UNKNOWN_LOCATION; context->last_module = 0; context->x_data = NULL; context->lock = 0; @@ -263,9 +264,11 @@ diagnostic_show_locus (diagnostic_context * context, if (!context->show_caret - || diagnostic->location <= BUILTINS_LOCATION) + || diagnostic->location <= BUILTINS_LOCATION + || diagnostic->location == context->last_location) return; + context->last_location = diagnostic->location; s = expand_location_to_spelling_point (diagnostic->location); line = location_get_source_line (s); if (line == NULL) @@ -542,7 +545,8 @@ diagnostic_report_diagnostic (diagnostic_context *context, diagnostic->kind = DK_ERROR; } - if (diagnostic->option_index) + if (diagnostic->option_index + && diagnostic->option_index != permissive_error_option (context)) { diagnostic_t diag_class = DK_UNSPECIFIED; |