Proper handling of -Werror=coverage-mismatch

From-SVN: r172870
This commit is contained in:
Xinliang David Li 2011-04-22 19:11:49 +00:00 committed by Xinliang David Li
parent 93dfac24ad
commit ae01169c69
3 changed files with 16 additions and 5 deletions

View file

@ -1,3 +1,10 @@
2011-04-22 Xinliang David Li <davidxl@google.com>
* 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 <jakub@redhat.com>
PR tree-optimization/48717

View file

@ -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);

View file

@ -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;