diff options
author | Gabriel Dos Reis <gdr@integrable-solutions.net> | 2004-08-30 04:48:34 +0000 |
---|---|---|
committer | Gabriel Dos Reis <gdr@gcc.gnu.org> | 2004-08-30 04:48:34 +0000 |
commit | 7783b402031d4ca66e2a29fa90855ea7fab965b0 (patch) | |
tree | 103c28a53c7590a4369c890c344849d943d7820c /gcc/diagnostic.c | |
parent | 04204c2fbf4cb7db7e6b1ce8691ef99f7610f0ee (diff) | |
download | gcc-7783b402031d4ca66e2a29fa90855ea7fab965b0.zip gcc-7783b402031d4ca66e2a29fa90855ea7fab965b0.tar.gz gcc-7783b402031d4ca66e2a29fa90855ea7fab965b0.tar.bz2 |
c-opts.c (c_common_handle_option): <case OPT_Werror> set global_dc->warning_as_error_requested.
* c-opts.c (c_common_handle_option): <case OPT_Werror> set
global_dc->warning_as_error_requested.
* diagnostic.c (diagnostic_initialize): Tidy.
* diagnostic.h (diagnostic_context::x_data): Remove
(diagnostic_context::issue_warnings_are_errors_message): Rename
from warnings_are_errors_message.
(diagnostic_context::warning_as_error_requested): New.
From-SVN: r86750
Diffstat (limited to 'gcc/diagnostic.c')
-rw-r--r-- | gcc/diagnostic.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index db4c8fe..4fca486 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -107,7 +107,8 @@ diagnostic_initialize (diagnostic_context *context) context->printer->prefixing_rule = DIAGNOSTICS_SHOW_PREFIX_ONCE; memset (context->diagnostic_count, 0, sizeof context->diagnostic_count); - context->warnings_are_errors_message = warnings_are_errors; + context->issue_warnings_are_errors_message = true; + context->warning_as_error_requested = false; context->abort_on_error = false; context->internal_error = NULL; diagnostic_starter (context) = default_diagnostic_starter; @@ -115,7 +116,6 @@ diagnostic_initialize (diagnostic_context *context) context->last_module = 0; context->last_function = NULL; context->lock = 0; - context->x_data = NULL; } /* Returns true if the next format specifier in TEXT is a format specifier @@ -226,17 +226,16 @@ diagnostic_count_diagnostic (diagnostic_context *context, if (!diagnostic_report_warnings_p ()) return false; - if (!warnings_are_errors) + if (!context->warning_as_error_requested) { ++diagnostic_kind_count (context, DK_WARNING); break; } - - if (context->warnings_are_errors_message) + else if (context->issue_warnings_are_errors_message) { pp_verbatim (context->printer, "%s: warnings being treated as errors\n", progname); - context->warnings_are_errors_message = false; + context->issue_warnings_are_errors_message = false; } /* And fall through. */ |