From dee158440e16ef7272d823b9bd5e6d414968fd8a Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Sat, 2 Jul 2005 11:55:32 +0100 Subject: toplev.c (default_tree_printer): Handle setting location with '+' flag. 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. From-SVN: r101532 --- gcc/c-format.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'gcc/c-format.c') diff --git a/gcc/c-format.c b/gcc/c-format.c index 28eefd95a45..5c4bb67dcde 100644 --- a/gcc/c-format.c +++ b/gcc/c-format.c @@ -391,6 +391,7 @@ static const format_flag_pair gcc_diag_flag_pairs[] = static const format_flag_spec gcc_diag_flag_specs[] = { + { '+', 0, 0, N_("'+' flag"), N_("the '+' printf flag"), STD_C89 }, { 'q', 0, 0, N_("'q' flag"), N_("the 'q' diagnostic flag"), STD_C89 }, { 'p', 0, 0, N_("precision"), N_("precision in printf format"), STD_C89 }, { 'L', 0, 0, N_("length modifier"), N_("length modifier in printf format"), STD_C89 }, @@ -558,7 +559,7 @@ static const format_char_info gcc_cdiag_char_table[] = { "H", 0, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL }, /* These will require a "tree" at runtime. */ - { "DEFJT", 0, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL }, + { "DEFJT", 0, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q+", "", NULL }, { "<>'", 0, STD_C89, NOARGUMENTS, "", "", NULL }, { "m", 0, STD_C89, NOARGUMENTS, "q", "", NULL }, @@ -659,13 +660,13 @@ static const format_kind_info format_types_orig[] = 'w', 0, 'p', 0, 'L', NULL, NULL }, - { "gcc_diag", gcc_diag_length_specs, gcc_diag_char_table, "q", NULL, + { "gcc_diag", gcc_diag_length_specs, gcc_diag_char_table, "q+", NULL, gcc_diag_flag_specs, gcc_diag_flag_pairs, FMT_FLAG_ARG_CONVERT, 0, 0, 'p', 0, 'L', NULL, &integer_type_node }, - { "gcc_cdiag", gcc_cdiag_length_specs, gcc_cdiag_char_table, "q", NULL, + { "gcc_cdiag", gcc_cdiag_length_specs, gcc_cdiag_char_table, "q+", NULL, gcc_cdiag_flag_specs, gcc_cdiag_flag_pairs, FMT_FLAG_ARG_CONVERT, 0, 0, 'p', 0, 'L', -- cgit v1.2.1