From ae01169c6918a8ba506c908372bcd4e01fd34714 Mon Sep 17 00:00:00 2001 From: Xinliang David Li Date: Fri, 22 Apr 2011 19:11:49 +0000 Subject: [PATCH] Proper handling of -Werror=coverage-mismatch From-SVN: r172870 --- gcc/ChangeLog | 7 +++++++ gcc/opts-global.c | 5 ----- gcc/toplev.c | 9 +++++++++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a30a78cb0cd..b334e323170 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2011-04-22 Xinliang David Li + + * toplev.c (process_options): Enable -Werror=coverage-mismatch + by default when -Wno-error is not specified. + * opts-global.c (decode_options): Remove call to + control_warning_options. + 2011-04-22 Jakub Jelinek PR tree-optimization/48717 diff --git a/gcc/opts-global.c b/gcc/opts-global.c index 71c428e9b6b..1134e3a2745 100644 --- a/gcc/opts-global.c +++ b/gcc/opts-global.c @@ -310,11 +310,6 @@ decode_options (struct gcc_options *opts, struct gcc_options *opts_set, set_default_handlers (&handlers); - /* Enable -Werror=coverage-mismatch by default. */ - control_warning_option (OPT_Wcoverage_mismatch, (int) DK_ERROR, true, - loc, lang_mask, - &handlers, opts, opts_set, dc); - default_options_optimization (opts, opts_set, decoded_options, decoded_options_count, loc, lang_mask, &handlers, dc); diff --git a/gcc/toplev.c b/gcc/toplev.c index c0f6ee3681e..06014a938e5 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1600,6 +1600,15 @@ process_options (void) flag_omit_frame_pointer = 0; } + /* Enable -Werror=coverage-mismatch when -Werror and -Wno-error + have not been set. */ + if (!global_options_set.x_warnings_are_errors + && warn_coverage_mismatch + && (global_dc->classify_diagnostic[OPT_Wcoverage_mismatch] == + DK_UNSPECIFIED)) + diagnostic_classify_diagnostic (global_dc, OPT_Wcoverage_mismatch, + DK_ERROR, UNKNOWN_LOCATION); + /* Save the current optimization options. */ optimization_default_node = build_optimization_node (); optimization_current_node = optimization_default_node; -- 2.30.2