aboutsummaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2005-07-02 10:55:32 +0000
committerJoseph Myers <joseph@codesourcery.com>2005-07-02 10:55:32 +0000
commitc4805a7cc81434193b64b54f7e59971a63a7e735 (patch)
tree3bc7f52a01952579e89d69c80d985e655c418278 /gcc/toplev.c
parent7cb92f93907c69d5024aca02cd5ab9afbd02118a (diff)
2005-07-02 Zack Weinberg <zack@codesourcery.com>
Joseph S. Myers <joseph@codesourcery.com> * toplev.c (default_tree_printer): Handle setting location with '+' flag. * c-objc.common.c (c_tree_printer): Likewise. * c-format.c (gcc_diag_flag_specs): Add '+'. (gcc_cdiag_char_table): Allow '+' flag for tree formats. (format_types_orig): Allow '+' flag for gcc_diag and gcc_cdiag formats. * c-common.c, c-decl.c, c-objc-common.c, c-pragma.c, config/arm/pe.c, config/i386/winnt.c, config/ia64/ia64.c, config/mcore/mcore.c, config/sh/symbian.c, config/sol2.c, config/v850/v850.c, function.c, stor-layout.c, toplev.c, tree-inline.c, tree-optimize.c, tree.c, varasm.c: Use '+' flag instead of %J or %H. Use 'q' flag for quoting. Avoid '.' at end of diagnostics. Use %q+D not %s for a decl. Do not pass excess format arguments where %J is used without %D. cp: * error.c (location_of): Add comment. (locate_error, cp_error_at, cp_warning_at, cp_pedwarn_at): Remove. * cp-tree.h (cp_error_at, cp_warning_at, cp_pedwarn_at): Remove. * call.c, class.c, decl.c, decl2.c, friend.c, init.c, name-lookup.c, parser.c, pt.c, search.c, semantics.c, typeck.c, typeck2.c: Use '+' flag instead of %J, cp_error_at, cp_warning_at or cp_pedwarn_at. Mark up some diagnostic strings with N_. java: * class.c, decl.c, expr.c: Use '+' flag instead of %J. Use 'q' flag for quoting. objc: * objc-act.c: Use '+' flag instead of %J. Use 'q' flag for quoting. testsuite: * gcc.dg/format/gcc_diag-1.c: Update. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@101532 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 0cfbcd25874..0b5278d710c 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -823,10 +823,10 @@ check_global_declarations (tree *vec, int len)
|| TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))))
{
if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
- pedwarn ("%J%qF used but never defined", decl, decl);
+ pedwarn ("%q+F used but never defined", decl);
else
- warning (0, "%J%qF declared %<static%> but never defined",
- decl, decl);
+ warning (0, "%q+F declared %<static%> but never defined",
+ decl);
/* This symbol is effectively an "extern" declaration now. */
TREE_PUBLIC (decl) = 1;
assemble_external (decl);
@@ -851,7 +851,7 @@ check_global_declarations (tree *vec, int len)
&& ! (TREE_CODE (decl) == VAR_DECL && DECL_REGISTER (decl))
/* Otherwise, ask the language. */
&& lang_hooks.decls.warn_unused_global (decl))
- warning (0, "%J%qD defined but not used", decl, decl);
+ warning (0, "%q+D defined but not used", decl);
/* Avoid confusing the debug information machinery when there are
errors. */
@@ -1356,12 +1356,12 @@ default_pch_valid_p (const void *data_p, size_t len)
/* Default tree printer. Handles declarations only. */
static bool
default_tree_printer (pretty_printer * pp, text_info *text, const char *spec,
- int precision, bool wide, bool plus, bool hash)
+ int precision, bool wide, bool set_locus, bool hash)
{
tree t;
/* FUTURE: %+x should set the locus. */
- if (precision != 0 || wide || plus || hash)
+ if (precision != 0 || wide || hash)
return false;
switch (*spec)
@@ -1381,6 +1381,9 @@ default_tree_printer (pretty_printer * pp, text_info *text, const char *spec,
return false;
}
+ if (set_locus && text->locus)
+ *text->locus = DECL_SOURCE_LOCATION (t);
+
if (DECL_P (t))
{
const char *n = DECL_NAME (t)