From 5e6392e809db05d347659bd40627f5fac4ade209 Mon Sep 17 00:00:00 2001 From: manu Date: Mon, 14 Sep 2015 19:27:50 +0000 Subject: The flag diagnostic_context::some_warnings_are_errors controls whether to give the message "all warnings being treated as errors". However, when warnings are buffered and then discarded, this flag is not reset. It turns out we do not need this flag at all, since we already count explicitly how many warnings were converted into errors, and this number is kept up to date for the buffered diagnostics used by Fortran. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gcc/ChangeLog: 2015-09-14 Manuel López-Ibáñez PR fortran/67460 * diagnostic.c (diagnostic_initialize): Do not set some_warnings_are_errors. (diagnostic_finish): Use DK_WERROR count instead. (diagnostic_report_diagnostic): Do not set some_warnings_are_errors. * diagnostic.h (struct diagnostic_context): Remove some_warnings_are_errors. gcc/testsuite/ChangeLog: 2015-09-14 Manuel López-Ibáñez PR fortran/67460 * gfortran.dg/pr67460.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227760 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/diagnostic.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'gcc/diagnostic.c') diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index 01a8e35d73b..e5c3c1dbfec 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -137,7 +137,6 @@ diagnostic_initialize (diagnostic_context *context, int n_opts) new (context->printer) pretty_printer (); memset (context->diagnostic_count, 0, sizeof context->diagnostic_count); - context->some_warnings_are_errors = false; context->warning_as_error_requested = false; context->n_opts = n_opts; context->classify_diagnostic = XNEWVEC (diagnostic_t, n_opts); @@ -204,7 +203,7 @@ void diagnostic_finish (diagnostic_context *context) { /* Some of the errors may actually have been warnings. */ - if (context->some_warnings_are_errors) + if (diagnostic_kind_count (context, DK_WERROR)) { /* -Werror was given. */ if (context->warning_as_error_requested) @@ -861,9 +860,6 @@ diagnostic_report_diagnostic (diagnostic_context *context, return false; } - if (orig_diag_kind == DK_WARNING && diagnostic->kind == DK_ERROR) - context->some_warnings_are_errors = true; - context->lock++; if (diagnostic->kind == DK_ICE || diagnostic->kind == DK_ICE_NOBT) -- cgit v1.2.1