diff options
author | Rafael Avila de Espindola <espindola@google.com> | 2008-07-21 14:29:27 +0000 |
---|---|---|
committer | Rafael Espindola <espindola@gcc.gnu.org> | 2008-07-21 14:29:27 +0000 |
commit | aa14403d28a1af7c28088dd4e04b36a4016e06f9 (patch) | |
tree | 1e111546a06e6c9f6855577afe7e36025fb4eb8c /gcc/diagnostic.c | |
parent | c44109aaf3be31a6816a8a4f3c4454261d8d2622 (diff) | |
download | gcc-aa14403d28a1af7c28088dd4e04b36a4016e06f9.zip gcc-aa14403d28a1af7c28088dd4e04b36a4016e06f9.tar.gz gcc-aa14403d28a1af7c28088dd4e04b36a4016e06f9.tar.bz2 |
Makefile.in: Replace toplev.h with TOPLEV_H.
2007-07-21 Rafael Avila de Espindola <espindola@google.com>
* Makefile.in: Replace toplev.h with TOPLEV_H.
* c-decl.c (merge_decls): Don't set DECL_IN_SYSTEM_HEADER.
* c-lex.c (fe_file_change): Don't set in_system_header.
* c-parser.c (c_token): Remove in_system_header.
(c_lex_one_token): Don't set in_system_header.
(c_parser_set_source_position_from_token): Don't set in_system_header.
* diagnostic.c (diagnostic_report_diagnostic): Use location from
diagnostic_info.
(warning_at): New.
* diagnostic.h (diagnostic_report_warnings_p): Add LOC argument.
* flags.h (in_system_header): Remove.
* function.c (saved_in_system_header): Remove.
(push_cfun): Don't set in_system_header.
(pop_cfun): Don't set in_system_header.
(push_struct_function): Don't set in_system_header.
* input.h (expanded_location): Add sysp.
(in_system_header_at): New.
(in_system_header): New.
* toplev.c (in_system_header): Remove.
* toplev.h: Include input.h
(warning_at): New.
* tree-cfg.c (execute_warn_function_return): Call warning_at.
* tree-ssa.c (warn_uninit): Call warning_at.
(warn_uninitialized_var): Update calls to warn_uninit.
(warn_uninitialized_phi): Update calls to warn_uninit.
* tree.c (make_node_stat): Don't set DECL_IN_SYSTEM_HEADER.
(expand_location): Initialize xloc.sysp.
* tree.h (DECL_IN_SYSTEM_HEADER): Use in_system_header_at.
(tree_decl_with_vis): Remove in_system_header_flag.
2007-07-21 Rafael Avila de Espindola <espindola@google.com>
* parser.c (cp_token): Remove in_system_header.
(eof_token): Remove in_system_header.
(cp_lexer_get_preprocessor_token): Don't set in_system_header.
(cp_lexer_set_source_position_from_token): Don't set in_system_header.
(cp_parser_member_declaration): Use in_system_header_at.
* pt.c (lookup_template_class): Don't set DECL_IN_SYSTEM_HEADER.
(pop_tinst_level): Don't set in_system_header.
(instantiate_class_template): Don't set in_system_header.
(instantiate_decl): Don't set in_system_header.
(instantiate_pending_templates): Don't set in_system_header.
From-SVN: r138031
Diffstat (limited to 'gcc/diagnostic.c')
-rw-r--r-- | gcc/diagnostic.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c index 5a6aaee..c6500d8 100644 --- a/gcc/diagnostic.c +++ b/gcc/diagnostic.c @@ -299,13 +299,14 @@ void diagnostic_report_diagnostic (diagnostic_context *context, diagnostic_info *diagnostic) { + location_t location = diagnostic->location; bool maybe_print_warnings_as_errors_message = false; const char *saved_format_spec; /* Give preference to being able to inhibit warnings, before they get reclassified to something else. */ if (diagnostic->kind == DK_WARNING - && !diagnostic_report_warnings_p ()) + && !diagnostic_report_warnings_p (location)) return; if (context->lock > 0) @@ -470,8 +471,8 @@ inform (const char *gmsgid, ...) va_end (ap); } -/* A warning. Use this for code which is correct according to the - relevant language specification but is likely to be buggy anyway. */ +/* A warning at INPUT_LOCATION. Use this for code which is correct according + to the relevant language specification but is likely to be buggy anyway. */ void warning (int opt, const char *gmsgid, ...) { @@ -498,6 +499,22 @@ warning0 (const char *gmsgid, ...) va_end (ap); } +/* A warning at LOCATION. Use this for code which is correct according to the + relevant language specification but is likely to be buggy anyway. */ +void +warning_at (location_t location, int opt, const char *gmsgid, ...) +{ + diagnostic_info diagnostic; + va_list ap; + + va_start (ap, gmsgid); + diagnostic_set_info (&diagnostic, gmsgid, &ap, location, DK_WARNING); + diagnostic.option_index = opt; + + report_diagnostic (&diagnostic); + va_end (ap); +} + /* A "pedantic" warning: issues a warning unless -pedantic-errors was given on the command line, in which case it issues an error. Use this for diagnostics required by the relevant language standard, |