From ddd2d57e722237230da8eea70a2fcecb11bd0f81 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Sat, 20 Sep 2003 22:07:20 -0700 Subject: c-format.c (gcc_diag_char_table): Add %J. * c-format.c (gcc_diag_char_table): Add %J. (gcc_cdiag_char_table, gcc_cxxdiag_char_table): Likewise. (check_format_types): Fix wanted_type name lookup. (init_dynamic_diag_info): Setup %J. * diagnostic.c (text_specifies_location): Implement %J. * c-common.c, c-decl.c, c-objc-common.c, c-pragma.c, calls.c, dwarfout.c, expr.c, function.c, stmt.c, stor-layout.c, toplev.c, tree-inline.c, tree-optimize.c, varasm.c, config/arm/pe.c, config/i386/winnt.c, config/ia64/ia64.c, config/mcore/mcore.c, config/v850/v850.c, objc/objc-act.c: Use %J in diagnostics. * tree-inline.c: Include intl.h (inline_forbidden_p_1): Fix i18n of inline_forbidden_reason. * Makefile.in (tree-inline.o): Update. cp/ * decl.c, decl2.c, pt.c: Use %J in diagnostics. java/ * check-init.c, class.c, decl.c, expr.c: Use %J in diagnostics. testsuite/ * gcc.dg/format/gcc_diag-1.c: Add tests for %J. From-SVN: r71619 --- gcc/toplev.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'gcc/toplev.c') diff --git a/gcc/toplev.c b/gcc/toplev.c index 91409bf..03485bc 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1663,11 +1663,9 @@ check_global_declarations (tree *vec, int len) && ! TREE_PUBLIC (decl)) { if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))) - pedwarn ("%H'%F' used but never defined", - &DECL_SOURCE_LOCATION (decl), decl); + pedwarn ("%J'%F' used but never defined", decl, decl); else - warning ("%H'%F' declared `static' but never defined", - &DECL_SOURCE_LOCATION (decl), decl); + warning ("%J'%F' declared `static' but never defined", decl, decl); /* This symbol is effectively an "extern" declaration now. */ TREE_PUBLIC (decl) = 1; assemble_external (decl); @@ -1688,8 +1686,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 ("%H'%D' defined but not used", - &DECL_SOURCE_LOCATION (decl), decl); + warning ("%J'%D' defined but not used", decl, decl); /* Avoid confusing the debug information machinery when there are errors. */ @@ -2575,11 +2572,8 @@ rest_of_handle_inlining (tree decl) { if (warn_inline && lose && DECL_INLINE (decl)) { - char *msg = xmalloc (2 + strlen (lose) + 1); - msg[0] = '%'; - msg[1] = 'H'; - strcpy(msg + 2, lose); - warning (msg, &DECL_SOURCE_LOCATION (decl)); + char *msg = concat ("%J", lose, NULL); + warning (msg, decl); free (msg); } DECL_ABSTRACT_ORIGIN (decl) = 0; -- cgit v1.1