From 3cf8b391b5f30be2e0c5404396abcfa20d88751e Mon Sep 17 00:00:00 2001 From: jsm28 Date: Sat, 2 Jul 2005 10:55:32 +0000 Subject: 2005-07-02 Zack Weinberg Joseph S. Myers * 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: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101532 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/c-objc-common.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'gcc/c-objc-common.c') diff --git a/gcc/c-objc-common.c b/gcc/c-objc-common.c index 0fb5b619ba4..eb556b142e1 100644 --- a/gcc/c-objc-common.c +++ b/gcc/c-objc-common.c @@ -78,8 +78,8 @@ c_cannot_inline_tree_fn (tree *fnp) && lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)) == NULL) { if (do_warning) - warning (0, "%Jfunction %qF can never be inlined because it " - "is suppressed using -fno-inline", fn, fn); + warning (0, "function %q+F can never be inlined because it " + "is suppressed using -fno-inline", fn); goto cannot_inline; } @@ -88,16 +88,16 @@ c_cannot_inline_tree_fn (tree *fnp) if (!DECL_DECLARED_INLINE_P (fn) && !targetm.binds_local_p (fn)) { if (do_warning) - warning (0, "%Jfunction %qF can never be inlined because it might not " - "be bound within this unit of translation", fn, fn); + warning (0, "function %q+F can never be inlined because it might not " + "be bound within this unit of translation", fn); goto cannot_inline; } if (!function_attribute_inlinable_p (fn)) { if (do_warning) - warning (0, "%Jfunction %qF can never be inlined because it uses " - "attributes conflicting with inlining", fn, fn); + warning (0, "function %q+F can never be inlined because it uses " + "attributes conflicting with inlining", fn); goto cannot_inline; } @@ -162,7 +162,7 @@ c_objc_common_init (void) diagnostic machinery. */ static bool c_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 = va_arg (*text->args_ptr, tree); tree name; @@ -170,10 +170,12 @@ c_tree_printer (pretty_printer *pp, text_info *text, const char *spec, c_pretty_printer *cpp = (c_pretty_printer *) pp; pp->padding = pp_none; - /* FUTURE: %+x should set the locus. */ - if (precision != 0 || wide || plus || hash) + if (precision != 0 || wide || hash) return false; + if (set_locus && text->locus) + *text->locus = DECL_SOURCE_LOCATION (t); + switch (*spec) { case 'D': -- cgit v1.2.1