attribs.c, [...]: Use %<, %> and %q for quoting in diagnostics going through pretty-print.c.

gcc:
	* attribs.c, builtins.c, c-format.c, c-pch.c, coverage.c,
	except.c, fold-const.c, function.c, langhooks.c, params.c,
	reload.c, reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c,
	tree-dump.c, tree-mudflap.c, tree.c, varasm.c: Use %<, %> and %q
	for quoting in diagnostics going through pretty-print.c.  Use ''
	for quoting in other diagnostic text.
	* langhooks.c: Include intl.h.  Mark text locating diagnostics for
	translation.
	* Makefile.in (langhooks.o): Update dependencies.
	* pretty-print.h (pp_printf): Mark as accepting GCC diagnostic
	formats.

gcc/testsuite:
	* g++.dg/ext/member-attr.C, g++.dg/warn/deprecated.C,
	gcc.dg/deprecated.c, gcc.dg/noreturn-1.c, gcc.dg/noreturn-4.c:
	Update expected messages.

libmudflap:
	* testsuite/libmudflap.c/pass35-frag.c: Update expected message.

From-SVN: r87563
This commit is contained in:
Joseph Myers 2004-09-15 21:48:10 +01:00 committed by Joseph Myers
parent 1daf6f3a5b
commit 971801fff6
31 changed files with 282 additions and 233 deletions

View file

@ -1,3 +1,17 @@
2004-09-15 Joseph S. Myers <jsm@polyomino.org.uk>
* attribs.c, builtins.c, c-format.c, c-pch.c, coverage.c,
except.c, fold-const.c, function.c, langhooks.c, params.c,
reload.c, reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c,
tree-dump.c, tree-mudflap.c, tree.c, varasm.c: Use %<, %> and %q
for quoting in diagnostics going through pretty-print.c. Use ''
for quoting in other diagnostic text.
* langhooks.c: Include intl.h. Mark text locating diagnostics for
translation.
* Makefile.in (langhooks.o): Update dependencies.
* pretty-print.h (pp_printf): Mark as accepting GCC diagnostic
formats.
2004-09-15 Mark Mitchell <mark@codesourcery.com> 2004-09-15 Mark Mitchell <mark@codesourcery.com>
* configure.ac: Check for COMDAT support. Robustify check for * configure.ac: Check for COMDAT support. Robustify check for

View file

@ -1577,7 +1577,7 @@ convert.o: convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(FLA
langhooks.o : langhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) toplev.h \ langhooks.o : langhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) toplev.h \
tree-inline.h $(RTL_H) insn-config.h $(INTEGRATE_H) langhooks.h \ tree-inline.h $(RTL_H) insn-config.h $(INTEGRATE_H) langhooks.h \
$(LANGHOOKS_DEF_H) $(FLAGS_H) $(GGC_H) diagnostic.h $(LANGHOOKS_DEF_H) $(FLAGS_H) $(GGC_H) diagnostic.h intl.h
tree.o : tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \ tree.o : tree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(FLAGS_H) function.h $(PARAMS_H) \ $(FLAGS_H) function.h $(PARAMS_H) \
toplev.h $(GGC_H) $(HASHTAB_H) $(TARGET_H) output.h $(TM_P_H) langhooks.h \ toplev.h $(GGC_H) $(HASHTAB_H) $(TARGET_H) output.h $(TM_P_H) langhooks.h \

View file

@ -172,7 +172,7 @@ decl_attributes (tree *node, tree attributes, int flags)
if (spec == NULL) if (spec == NULL)
{ {
warning ("`%s' attribute directive ignored", warning ("%qs attribute directive ignored",
IDENTIFIER_POINTER (name)); IDENTIFIER_POINTER (name));
continue; continue;
} }
@ -180,7 +180,7 @@ decl_attributes (tree *node, tree attributes, int flags)
|| (spec->max_length >= 0 || (spec->max_length >= 0
&& list_length (args) > spec->max_length)) && list_length (args) > spec->max_length))
{ {
error ("wrong number of arguments specified for `%s' attribute", error ("wrong number of arguments specified for %qs attribute",
IDENTIFIER_POINTER (name)); IDENTIFIER_POINTER (name));
continue; continue;
} }
@ -197,7 +197,7 @@ decl_attributes (tree *node, tree attributes, int flags)
} }
else else
{ {
warning ("`%s' attribute does not apply to types", warning ("%qs attribute does not apply to types",
IDENTIFIER_POINTER (name)); IDENTIFIER_POINTER (name));
continue; continue;
} }
@ -243,7 +243,7 @@ decl_attributes (tree *node, tree attributes, int flags)
if (TREE_CODE (*anode) != FUNCTION_TYPE if (TREE_CODE (*anode) != FUNCTION_TYPE
&& TREE_CODE (*anode) != METHOD_TYPE) && TREE_CODE (*anode) != METHOD_TYPE)
{ {
warning ("`%s' attribute only applies to function types", warning ("%qs attribute only applies to function types",
IDENTIFIER_POINTER (name)); IDENTIFIER_POINTER (name));
continue; continue;
} }

View file

@ -924,7 +924,7 @@ expand_builtin_prefetch (tree arglist)
/* Argument 1 (read/write flag) must be a compile-time constant int. */ /* Argument 1 (read/write flag) must be a compile-time constant int. */
if (TREE_CODE (arg1) != INTEGER_CST) if (TREE_CODE (arg1) != INTEGER_CST)
{ {
error ("second arg to `__builtin_prefetch' must be a constant"); error ("second arg to %<__builtin_prefetch%> must be a constant");
arg1 = integer_zero_node; arg1 = integer_zero_node;
} }
op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0); op1 = expand_expr (arg1, NULL_RTX, VOIDmode, 0);
@ -938,7 +938,7 @@ expand_builtin_prefetch (tree arglist)
/* Argument 2 (locality) must be a compile-time constant int. */ /* Argument 2 (locality) must be a compile-time constant int. */
if (TREE_CODE (arg2) != INTEGER_CST) if (TREE_CODE (arg2) != INTEGER_CST)
{ {
error ("third arg to `__builtin_prefetch' must be a constant"); error ("third arg to %<__builtin_prefetch%> must be a constant");
arg2 = integer_zero_node; arg2 = integer_zero_node;
} }
op2 = expand_expr (arg2, NULL_RTX, VOIDmode, 0); op2 = expand_expr (arg2, NULL_RTX, VOIDmode, 0);
@ -4147,19 +4147,19 @@ expand_builtin_args_info (tree arglist)
if (arglist != 0) if (arglist != 0)
{ {
if (!host_integerp (TREE_VALUE (arglist), 0)) if (!host_integerp (TREE_VALUE (arglist), 0))
error ("argument of `__builtin_args_info' must be constant"); error ("argument of %<__builtin_args_info%> must be constant");
else else
{ {
HOST_WIDE_INT wordnum = tree_low_cst (TREE_VALUE (arglist), 0); HOST_WIDE_INT wordnum = tree_low_cst (TREE_VALUE (arglist), 0);
if (wordnum < 0 || wordnum >= nwords) if (wordnum < 0 || wordnum >= nwords)
error ("argument of `__builtin_args_info' out of range"); error ("argument of %<__builtin_args_info%> out of range");
else else
return GEN_INT (word_ptr[wordnum]); return GEN_INT (word_ptr[wordnum]);
} }
} }
else else
error ("missing argument in `__builtin_args_info'"); error ("missing argument in %<__builtin_args_info%>");
return const0_rtx; return const0_rtx;
} }
@ -4175,7 +4175,7 @@ expand_builtin_next_arg (tree arglist)
|| (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype))) || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype)))
== void_type_node)) == void_type_node))
{ {
error ("`va_start' used in function with fixed args"); error ("%<va_start%> used in function with fixed args");
return const0_rtx; return const0_rtx;
} }
@ -4194,12 +4194,12 @@ expand_builtin_next_arg (tree arglist)
|| TREE_CODE (arg) == INDIRECT_REF) || TREE_CODE (arg) == INDIRECT_REF)
arg = TREE_OPERAND (arg, 0); arg = TREE_OPERAND (arg, 0);
if (arg != last_parm) if (arg != last_parm)
warning ("second parameter of `va_start' not last named argument"); warning ("second parameter of %<va_start%> not last named argument");
} }
else else
/* Evidently an out of date version of <stdarg.h>; can't validate /* Evidently an out of date version of <stdarg.h>; can't validate
va_start's second argument, but can still work as intended. */ va_start's second argument, but can still work as intended. */
warning ("`__builtin_next_arg' called without an argument"); warning ("%<__builtin_next_arg%> called without an argument");
return expand_binop (Pmode, add_optab, return expand_binop (Pmode, add_optab,
current_function_internal_arg_pointer, current_function_internal_arg_pointer,
@ -4284,7 +4284,7 @@ expand_builtin_va_start (tree arglist)
chain = TREE_CHAIN (arglist); chain = TREE_CHAIN (arglist);
if (TREE_CHAIN (chain)) if (TREE_CHAIN (chain))
error ("too many arguments to function `va_start'"); error ("too many arguments to function %<va_start%>");
nextarg = expand_builtin_next_arg (chain); nextarg = expand_builtin_next_arg (chain);
valist = stabilize_va_list (TREE_VALUE (arglist), 1); valist = stabilize_va_list (TREE_VALUE (arglist), 1);
@ -4430,7 +4430,7 @@ gimplify_va_arg_expr (tree *expr_p, tree *pre_p, tree *post_p)
if (TYPE_MAIN_VARIANT (want_va_type) != TYPE_MAIN_VARIANT (have_va_type)) if (TYPE_MAIN_VARIANT (want_va_type) != TYPE_MAIN_VARIANT (have_va_type))
{ {
error ("first argument to `va_arg' not of type `va_list'"); error ("first argument to %<va_arg%> not of type %<va_list%>");
return GS_ERROR; return GS_ERROR;
} }
@ -4444,12 +4444,12 @@ gimplify_va_arg_expr (tree *expr_p, tree *pre_p, tree *post_p)
/* Unfortunately, this is merely undefined, rather than a constraint /* Unfortunately, this is merely undefined, rather than a constraint
violation, so we cannot make this an error. If this call is never violation, so we cannot make this an error. If this call is never
executed, the program is still strictly conforming. */ executed, the program is still strictly conforming. */
warning ("`%T' is promoted to `%T' when passed through `...'", warning ("%qT is promoted to %qT when passed through %<...%>",
type, promoted_type); type, promoted_type);
if (! gave_help) if (! gave_help)
{ {
gave_help = true; gave_help = true;
warning ("(so you should pass `%T' not `%T' to `va_arg')", warning ("(so you should pass %qT not %qT to %<va_arg%>)",
promoted_type, type); promoted_type, type);
} }
@ -4573,9 +4573,9 @@ expand_builtin_frame_address (tree fndecl, tree arglist)
else if (! host_integerp (TREE_VALUE (arglist), 1)) else if (! host_integerp (TREE_VALUE (arglist), 1))
{ {
if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_FRAME_ADDRESS) if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_FRAME_ADDRESS)
error ("invalid arg to `__builtin_frame_address'"); error ("invalid arg to %<__builtin_frame_address%>");
else else
error ("invalid arg to `__builtin_return_address'"); error ("invalid arg to %<__builtin_return_address%>");
return const0_rtx; return const0_rtx;
} }
else else
@ -4589,9 +4589,9 @@ expand_builtin_frame_address (tree fndecl, tree arglist)
if (tem == NULL) if (tem == NULL)
{ {
if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_FRAME_ADDRESS) if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_FRAME_ADDRESS)
warning ("unsupported arg to `__builtin_frame_address'"); warning ("unsupported arg to %<__builtin_frame_address%>");
else else
warning ("unsupported arg to `__builtin_return_address'"); warning ("unsupported arg to %<__builtin_return_address%>");
return const0_rtx; return const0_rtx;
} }
@ -4757,7 +4757,7 @@ expand_builtin_expect (tree arglist, rtx target)
if (TREE_CODE (c) != INTEGER_CST) if (TREE_CODE (c) != INTEGER_CST)
{ {
error ("second arg to `__builtin_expect' must be a constant"); error ("second arg to %<__builtin_expect%> must be a constant");
c = integer_zero_node; c = integer_zero_node;
} }
@ -8040,19 +8040,19 @@ fold_builtin_classify (tree exp, int builtin_index)
/* Check that we have exactly one argument. */ /* Check that we have exactly one argument. */
if (arglist == 0) if (arglist == 0)
{ {
error ("too few arguments to function `%s'", error ("too few arguments to function %qs",
IDENTIFIER_POINTER (DECL_NAME (fndecl))); IDENTIFIER_POINTER (DECL_NAME (fndecl)));
return error_mark_node; return error_mark_node;
} }
else if (TREE_CHAIN (arglist) != 0) else if (TREE_CHAIN (arglist) != 0)
{ {
error ("too many arguments to function `%s'", error ("too many arguments to function %qs",
IDENTIFIER_POINTER (DECL_NAME (fndecl))); IDENTIFIER_POINTER (DECL_NAME (fndecl)));
return error_mark_node; return error_mark_node;
} }
else else
{ {
error ("non-floating-point argument to function `%s'", error ("non-floating-point argument to function %qs",
IDENTIFIER_POINTER (DECL_NAME (fndecl))); IDENTIFIER_POINTER (DECL_NAME (fndecl)));
return error_mark_node; return error_mark_node;
} }
@ -8136,13 +8136,13 @@ fold_builtin_unordered_cmp (tree exp,
/* Check that we have exactly two arguments. */ /* Check that we have exactly two arguments. */
if (arglist == 0 || TREE_CHAIN (arglist) == 0) if (arglist == 0 || TREE_CHAIN (arglist) == 0)
{ {
error ("too few arguments to function `%s'", error ("too few arguments to function %qs",
IDENTIFIER_POINTER (DECL_NAME (fndecl))); IDENTIFIER_POINTER (DECL_NAME (fndecl)));
return error_mark_node; return error_mark_node;
} }
else if (TREE_CHAIN (TREE_CHAIN (arglist)) != 0) else if (TREE_CHAIN (TREE_CHAIN (arglist)) != 0)
{ {
error ("too many arguments to function `%s'", error ("too many arguments to function %qs",
IDENTIFIER_POINTER (DECL_NAME (fndecl))); IDENTIFIER_POINTER (DECL_NAME (fndecl)));
return error_mark_node; return error_mark_node;
} }
@ -8166,7 +8166,7 @@ fold_builtin_unordered_cmp (tree exp,
cmp_type = type1; cmp_type = type1;
else else
{ {
error ("non-floating-point argument to function `%s'", error ("non-floating-point argument to function %qs",
IDENTIFIER_POINTER (DECL_NAME (fndecl))); IDENTIFIER_POINTER (DECL_NAME (fndecl)));
return error_mark_node; return error_mark_node;
} }
@ -9247,7 +9247,7 @@ simplify_builtin_va_start (tree arglist)
tree chain = TREE_CHAIN (arglist); tree chain = TREE_CHAIN (arglist);
if (TREE_CHAIN (chain)) if (TREE_CHAIN (chain))
error ("too many arguments to function `va_start'"); error ("too many arguments to function %<va_start%>");
simplify_builtin_next_arg (chain); simplify_builtin_next_arg (chain);
} }
@ -9260,7 +9260,7 @@ simplify_builtin_next_arg (tree arglist)
if (TYPE_ARG_TYPES (fntype) == 0 if (TYPE_ARG_TYPES (fntype) == 0
|| (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype))) || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype)))
== void_type_node)) == void_type_node))
error ("`va_start' used in function with fixed args"); error ("%<va_start%> used in function with fixed args");
else if (arglist) else if (arglist)
{ {
tree last_parm = tree_last (DECL_ARGUMENTS (current_function_decl)); tree last_parm = tree_last (DECL_ARGUMENTS (current_function_decl));
@ -9276,13 +9276,13 @@ simplify_builtin_next_arg (tree arglist)
|| TREE_CODE (arg) == INDIRECT_REF) || TREE_CODE (arg) == INDIRECT_REF)
arg = TREE_OPERAND (arg, 0); arg = TREE_OPERAND (arg, 0);
if (arg != last_parm) if (arg != last_parm)
warning ("second parameter of `va_start' not last named argument"); warning ("second parameter of %<va_start%> not last named argument");
TREE_VALUE (arglist) = arg; TREE_VALUE (arglist) = arg;
} }
else else
/* Evidently an out of date version of <stdarg.h>; can't validate /* Evidently an out of date version of <stdarg.h>; can't validate
va_start's second argument, but can still work as intended. */ va_start's second argument, but can still work as intended. */
warning ("`__builtin_next_arg' called without an argument"); warning ("%<__builtin_next_arg%> called without an argument");
} }

View file

@ -342,13 +342,13 @@ static const format_length_info strfmon_length_specs[] =
static const format_flag_spec printf_flag_specs[] = static const format_flag_spec printf_flag_specs[] =
{ {
{ ' ', 0, 0, N_("` ' flag"), N_("the ` ' printf flag"), STD_C89 }, { ' ', 0, 0, N_("' ' flag"), N_("the ' ' printf flag"), STD_C89 },
{ '+', 0, 0, N_("`+' flag"), N_("the `+' printf flag"), STD_C89 }, { '+', 0, 0, N_("'+' flag"), N_("the '+' printf flag"), STD_C89 },
{ '#', 0, 0, N_("`#' flag"), N_("the `#' printf flag"), STD_C89 }, { '#', 0, 0, N_("'#' flag"), N_("the '#' printf flag"), STD_C89 },
{ '0', 0, 0, N_("`0' flag"), N_("the `0' printf flag"), STD_C89 }, { '0', 0, 0, N_("'0' flag"), N_("the '0' printf flag"), STD_C89 },
{ '-', 0, 0, N_("`-' flag"), N_("the `-' printf flag"), STD_C89 }, { '-', 0, 0, N_("'-' flag"), N_("the '-' printf flag"), STD_C89 },
{ '\'', 0, 0, N_("`'' flag"), N_("the `'' printf flag"), STD_EXT }, { '\'', 0, 0, N_("''' flag"), N_("the ''' printf flag"), STD_EXT },
{ 'I', 0, 0, N_("`I' flag"), N_("the `I' printf flag"), STD_EXT }, { 'I', 0, 0, N_("'I' flag"), N_("the 'I' printf flag"), STD_EXT },
{ 'w', 0, 0, N_("field width"), N_("field width in printf format"), STD_C89 }, { 'w', 0, 0, N_("field width"), N_("field width in printf format"), STD_C89 },
{ 'p', 0, 0, N_("precision"), N_("precision in printf format"), 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 }, { 'L', 0, 0, N_("length modifier"), N_("length modifier in printf format"), STD_C89 },
@ -366,11 +366,11 @@ static const format_flag_pair printf_flag_pairs[] =
static const format_flag_spec asm_fprintf_flag_specs[] = static const format_flag_spec asm_fprintf_flag_specs[] =
{ {
{ ' ', 0, 0, N_("` ' flag"), N_("the ` ' printf flag"), STD_C89 }, { ' ', 0, 0, N_("' ' flag"), N_("the ' ' printf flag"), STD_C89 },
{ '+', 0, 0, N_("`+' flag"), N_("the `+' printf flag"), STD_C89 }, { '+', 0, 0, N_("'+' flag"), N_("the '+' printf flag"), STD_C89 },
{ '#', 0, 0, N_("`#' flag"), N_("the `#' printf flag"), STD_C89 }, { '#', 0, 0, N_("'#' flag"), N_("the '#' printf flag"), STD_C89 },
{ '0', 0, 0, N_("`0' flag"), N_("the `0' printf flag"), STD_C89 }, { '0', 0, 0, N_("'0' flag"), N_("the '0' printf flag"), STD_C89 },
{ '-', 0, 0, N_("`-' flag"), N_("the `-' printf flag"), STD_C89 }, { '-', 0, 0, N_("'-' flag"), N_("the '-' printf flag"), STD_C89 },
{ 'w', 0, 0, N_("field width"), N_("field width in printf format"), STD_C89 }, { 'w', 0, 0, N_("field width"), N_("field width in printf format"), STD_C89 },
{ 'p', 0, 0, N_("precision"), N_("precision in printf format"), 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 }, { 'L', 0, 0, N_("length modifier"), N_("length modifier in printf format"), STD_C89 },
@ -395,7 +395,7 @@ static const format_flag_pair gcc_diag_flag_pairs[] =
static const format_flag_spec gcc_diag_flag_specs[] = static const format_flag_spec gcc_diag_flag_specs[] =
{ {
{ 'q', 0, 0, N_("`q' flag"), N_("the `q' diagnostic 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 }, { '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 }, { 'L', 0, 0, N_("length modifier"), N_("length modifier in printf format"), STD_C89 },
{ 0, 0, 0, NULL, NULL, 0 } { 0, 0, 0, NULL, NULL, 0 }
@ -405,9 +405,9 @@ static const format_flag_spec gcc_diag_flag_specs[] =
static const format_flag_spec gcc_cxxdiag_flag_specs[] = static const format_flag_spec gcc_cxxdiag_flag_specs[] =
{ {
{ '+', 0, 0, N_("`+' flag"), N_("the `+' printf flag"), STD_C89 }, { '+', 0, 0, N_("'+' flag"), N_("the '+' printf flag"), STD_C89 },
{ '#', 0, 0, N_("`#' flag"), N_("the `#' printf flag"), STD_C89 }, { '#', 0, 0, N_("'#' flag"), N_("the '#' printf flag"), STD_C89 },
{ 'q', 0, 0, N_("`q' flag"), N_("the `q' diagnostic 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 }, { '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 }, { 'L', 0, 0, N_("length modifier"), N_("length modifier in printf format"), STD_C89 },
{ 0, 0, 0, NULL, NULL, 0 } { 0, 0, 0, NULL, NULL, 0 }
@ -416,11 +416,11 @@ static const format_flag_spec gcc_cxxdiag_flag_specs[] =
static const format_flag_spec scanf_flag_specs[] = static const format_flag_spec scanf_flag_specs[] =
{ {
{ '*', 0, 0, N_("assignment suppression"), N_("the assignment suppression scanf feature"), STD_C89 }, { '*', 0, 0, N_("assignment suppression"), N_("the assignment suppression scanf feature"), STD_C89 },
{ 'a', 0, 0, N_("`a' flag"), N_("the `a' scanf flag"), STD_EXT }, { 'a', 0, 0, N_("'a' flag"), N_("the 'a' scanf flag"), STD_EXT },
{ 'w', 0, 0, N_("field width"), N_("field width in scanf format"), STD_C89 }, { 'w', 0, 0, N_("field width"), N_("field width in scanf format"), STD_C89 },
{ 'L', 0, 0, N_("length modifier"), N_("length modifier in scanf format"), STD_C89 }, { 'L', 0, 0, N_("length modifier"), N_("length modifier in scanf format"), STD_C89 },
{ '\'', 0, 0, N_("`'' flag"), N_("the `'' scanf flag"), STD_EXT }, { '\'', 0, 0, N_("''' flag"), N_("the ''' scanf flag"), STD_EXT },
{ 'I', 0, 0, N_("`I' flag"), N_("the `I' scanf flag"), STD_EXT }, { 'I', 0, 0, N_("'I' flag"), N_("the 'I' scanf flag"), STD_EXT },
{ 0, 0, 0, NULL, NULL, 0 } { 0, 0, 0, NULL, NULL, 0 }
}; };
@ -434,15 +434,15 @@ static const format_flag_pair scanf_flag_pairs[] =
static const format_flag_spec strftime_flag_specs[] = static const format_flag_spec strftime_flag_specs[] =
{ {
{ '_', 0, 0, N_("`_' flag"), N_("the `_' strftime flag"), STD_EXT }, { '_', 0, 0, N_("'_' flag"), N_("the '_' strftime flag"), STD_EXT },
{ '-', 0, 0, N_("`-' flag"), N_("the `-' strftime flag"), STD_EXT }, { '-', 0, 0, N_("'-' flag"), N_("the '-' strftime flag"), STD_EXT },
{ '0', 0, 0, N_("`0' flag"), N_("the `0' strftime flag"), STD_EXT }, { '0', 0, 0, N_("'0' flag"), N_("the '0' strftime flag"), STD_EXT },
{ '^', 0, 0, N_("`^' flag"), N_("the `^' strftime flag"), STD_EXT }, { '^', 0, 0, N_("'^' flag"), N_("the '^' strftime flag"), STD_EXT },
{ '#', 0, 0, N_("`#' flag"), N_("the `#' strftime flag"), STD_EXT }, { '#', 0, 0, N_("'#' flag"), N_("the '#' strftime flag"), STD_EXT },
{ 'w', 0, 0, N_("field width"), N_("field width in strftime format"), STD_EXT }, { 'w', 0, 0, N_("field width"), N_("field width in strftime format"), STD_EXT },
{ 'E', 0, 0, N_("`E' modifier"), N_("the `E' strftime modifier"), STD_C99 }, { 'E', 0, 0, N_("'E' modifier"), N_("the 'E' strftime modifier"), STD_C99 },
{ 'O', 0, 0, N_("`O' modifier"), N_("the `O' strftime modifier"), STD_C99 }, { 'O', 0, 0, N_("'O' modifier"), N_("the 'O' strftime modifier"), STD_C99 },
{ 'O', 'o', 0, NULL, N_("the `O' modifier"), STD_EXT }, { 'O', 'o', 0, NULL, N_("the 'O' modifier"), STD_EXT },
{ 0, 0, 0, NULL, NULL, 0 } { 0, 0, 0, NULL, NULL, 0 }
}; };
@ -461,11 +461,11 @@ static const format_flag_pair strftime_flag_pairs[] =
static const format_flag_spec strfmon_flag_specs[] = static const format_flag_spec strfmon_flag_specs[] =
{ {
{ '=', 0, 1, N_("fill character"), N_("fill character in strfmon format"), STD_C89 }, { '=', 0, 1, N_("fill character"), N_("fill character in strfmon format"), STD_C89 },
{ '^', 0, 0, N_("`^' flag"), N_("the `^' strfmon flag"), STD_C89 }, { '^', 0, 0, N_("'^' flag"), N_("the '^' strfmon flag"), STD_C89 },
{ '+', 0, 0, N_("`+' flag"), N_("the `+' strfmon flag"), STD_C89 }, { '+', 0, 0, N_("'+' flag"), N_("the '+' strfmon flag"), STD_C89 },
{ '(', 0, 0, N_("`(' flag"), N_("the `(' strfmon flag"), STD_C89 }, { '(', 0, 0, N_("'(' flag"), N_("the '(' strfmon flag"), STD_C89 },
{ '!', 0, 0, N_("`!' flag"), N_("the `!' strfmon flag"), STD_C89 }, { '!', 0, 0, N_("'!' flag"), N_("the '!' strfmon flag"), STD_C89 },
{ '-', 0, 0, N_("`-' flag"), N_("the `-' strfmon flag"), STD_C89 }, { '-', 0, 0, N_("'-' flag"), N_("the '-' strfmon flag"), STD_C89 },
{ 'w', 0, 0, N_("field width"), N_("field width in strfmon format"), STD_C89 }, { 'w', 0, 0, N_("field width"), N_("field width in strfmon format"), STD_C89 },
{ '#', 0, 0, N_("left precision"), N_("left precision in strfmon format"), STD_C89 }, { '#', 0, 0, N_("left precision"), N_("left precision in strfmon format"), STD_C89 },
{ 'p', 0, 0, N_("right precision"), N_("right precision in strfmon format"), STD_C89 }, { 'p', 0, 0, N_("right precision"), N_("right precision in strfmon format"), STD_C89 },
@ -587,7 +587,7 @@ static const format_char_info gcc_cxxdiag_char_table[] =
/* These will require a "tree" at runtime. */ /* These will require a "tree" at runtime. */
{ "ADEFJTV",0,STD_C89,{ T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q+#", "", NULL }, { "ADEFJTV",0,STD_C89,{ T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q+#", "", NULL },
/* These accept either an `int' or an `enum tree_code' (which is handled as an `int'.) */ /* These accept either an 'int' or an 'enum tree_code' (which is handled as an 'int'.) */
{ "CLOPQ",0,STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL }, { "CLOPQ",0,STD_C89, { T89_I, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "q", "", NULL },
{ "<>'", 0, STD_C89, NOARGUMENTS, "", "", NULL }, { "<>'", 0, STD_C89, NOARGUMENTS, "", "", NULL },
@ -1720,7 +1720,7 @@ check_format_info_main (format_check_results *res,
if (format_chars[1] == 's' || format_chars[1] == 'S' if (format_chars[1] == 's' || format_chars[1] == 'S'
|| format_chars[1] == '[') || format_chars[1] == '[')
{ {
/* `a' is used as a flag. */ /* 'a' is used as a flag. */
i = strlen (flag_chars); i = strlen (flag_chars);
flag_chars[i++] = 'a'; flag_chars[i++] = 'a';
flag_chars[i] = 0; flag_chars[i] = 0;
@ -2137,7 +2137,7 @@ check_format_types (format_wanted_type *types, const char *format_start,
/* Check the type of the "real" argument, if there's a type we want. */ /* Check the type of the "real" argument, if there's a type we want. */
if (wanted_type == cur_type) if (wanted_type == cur_type)
continue; continue;
/* If we want `void *', allow any pointer type. /* If we want 'void *', allow any pointer type.
(Anything else would already have got a warning.) (Anything else would already have got a warning.)
With -pedantic, only allow pointers to void and to character With -pedantic, only allow pointers to void and to character
types. */ types. */
@ -2327,7 +2327,7 @@ init_dynamic_diag_info (void)
unsigned int i; unsigned int i;
/* For the GCC-diagnostics custom format specifiers to work, one /* For the GCC-diagnostics custom format specifiers to work, one
must have declared `tree' and/or `location_t' prior to using must have declared 'tree' and/or 'location_t' prior to using
those attributes. If we haven't seen these declarations then those attributes. If we haven't seen these declarations then
you shouldn't use the specifiers requiring these types. you shouldn't use the specifiers requiring these types.
However we don't force a hard ICE because we may see only one However we don't force a hard ICE because we may see only one
@ -2335,7 +2335,7 @@ init_dynamic_diag_info (void)
if ((loc = maybe_get_identifier ("location_t"))) if ((loc = maybe_get_identifier ("location_t")))
loc = TREE_TYPE (identifier_global_value (loc)); loc = TREE_TYPE (identifier_global_value (loc));
/* We need to grab the underlying `union tree_node' so peek into /* We need to grab the underlying 'union tree_node' so peek into
an extra type level. */ an extra type level. */
if ((t = maybe_get_identifier ("tree"))) if ((t = maybe_get_identifier ("tree")))
t = TREE_TYPE (TREE_TYPE (identifier_global_value (t))); t = TREE_TYPE (TREE_TYPE (identifier_global_value (t)));
@ -2529,7 +2529,7 @@ handle_format_attribute (tree *node, tree ARG_UNUSED (name), tree args,
if (info.format_type == asm_fprintf_format_type) if (info.format_type == asm_fprintf_format_type)
init_dynamic_asm_fprintf_info(); init_dynamic_asm_fprintf_info();
/* If this is one of the diagnostic attributes, then we have to /* If this is one of the diagnostic attributes, then we have to
initialize `location_t' and `tree' at runtime. */ initialize 'location_t' and 'tree' at runtime. */
else if (info.format_type == gcc_diag_format_type else if (info.format_type == gcc_diag_format_type
|| info.format_type == gcc_cdiag_format_type || info.format_type == gcc_cdiag_format_type
|| info.format_type == gcc_cxxdiag_format_type) || info.format_type == gcc_cxxdiag_format_type)

View file

@ -161,7 +161,7 @@ pch_init (void)
/* The driver always provides a valid -o option. */ /* The driver always provides a valid -o option. */
if (asm_file_name == NULL if (asm_file_name == NULL
|| strcmp (asm_file_name, "-") == 0) || strcmp (asm_file_name, "-") == 0)
fatal_error ("`%s' is not a valid output file", asm_file_name); fatal_error ("%qs is not a valid output file", asm_file_name);
asm_file_startpos = ftell (asm_out_file); asm_file_startpos = ftell (asm_out_file);
@ -284,7 +284,7 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd)
{ {
if (cpp_get_options (pfile)->warn_invalid_pch) if (cpp_get_options (pfile)->warn_invalid_pch)
cpp_error (pfile, CPP_DL_WARNING, cpp_error (pfile, CPP_DL_WARNING,
"%s: created on host `%.*s', but used on host `%s'", name, "%s: created on host '%.*s', but used on host '%s'", name,
v.host_machine_length, short_strings, host_machine); v.host_machine_length, short_strings, host_machine);
return 2; return 2;
} }
@ -294,7 +294,7 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd)
{ {
if (cpp_get_options (pfile)->warn_invalid_pch) if (cpp_get_options (pfile)->warn_invalid_pch)
cpp_error (pfile, CPP_DL_WARNING, cpp_error (pfile, CPP_DL_WARNING,
"%s: created for target `%.*s', but used for target `%s'", "%s: created for target '%.*s', but used for target '%s'",
name, v.target_machine_length, name, v.target_machine_length,
short_strings + v.host_machine_length, target_machine); short_strings + v.host_machine_length, target_machine);
return 2; return 2;
@ -307,7 +307,7 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd)
{ {
if (cpp_get_options (pfile)->warn_invalid_pch) if (cpp_get_options (pfile)->warn_invalid_pch)
cpp_error (pfile, CPP_DL_WARNING, cpp_error (pfile, CPP_DL_WARNING,
"%s: created by version `%.*s', but this is version `%s'", "%s: created by version '%.*s', but this is version '%s'",
name, v.version_length, name, v.version_length,
(short_strings + v.host_machine_length (short_strings + v.host_machine_length
+ v.target_machine_length), + v.target_machine_length),

View file

@ -165,7 +165,7 @@ read_counts_file (void)
if (!gcov_magic (gcov_read_unsigned (), GCOV_DATA_MAGIC)) if (!gcov_magic (gcov_read_unsigned (), GCOV_DATA_MAGIC))
{ {
warning ("`%s' is not a gcov data file", da_file_name); warning ("%qs is not a gcov data file", da_file_name);
gcov_close (); gcov_close ();
return; return;
} }
@ -176,7 +176,7 @@ read_counts_file (void)
GCOV_UNSIGNED2STRING (v, tag); GCOV_UNSIGNED2STRING (v, tag);
GCOV_UNSIGNED2STRING (e, GCOV_VERSION); GCOV_UNSIGNED2STRING (e, GCOV_VERSION);
warning ("`%s' is version `%.*s', expected version `%.*s'", warning ("%qs is version %q.*s, expected version %q.*s",
da_file_name, 4, v, 4, e); da_file_name, 4, v, 4, e);
gcov_close (); gcov_close ();
return; return;
@ -293,7 +293,7 @@ read_counts_file (void)
gcov_sync (offset, length); gcov_sync (offset, length);
if ((is_error = gcov_is_error ())) if ((is_error = gcov_is_error ()))
{ {
error (is_error < 0 ? "`%s' has overflowed" : "`%s' is corrupted", error (is_error < 0 ? "%qs has overflowed" : "%qs is corrupted",
da_file_name); da_file_name);
htab_delete (counts_hash); htab_delete (counts_hash);
break; break;
@ -330,7 +330,7 @@ get_coverage_counts (unsigned counter, unsigned expected,
entry = htab_find (counts_hash, &elt); entry = htab_find (counts_hash, &elt);
if (!entry) if (!entry)
{ {
warning ("no coverage for function '%s' found.", IDENTIFIER_POINTER warning ("no coverage for function %qs found.", IDENTIFIER_POINTER
(DECL_ASSEMBLER_NAME (current_function_decl))); (DECL_ASSEMBLER_NAME (current_function_decl)));
return 0; return 0;
} }
@ -338,7 +338,7 @@ get_coverage_counts (unsigned counter, unsigned expected,
checksum = compute_checksum (); checksum = compute_checksum ();
if (entry->checksum != checksum) if (entry->checksum != checksum)
{ {
error ("coverage mismatch for function '%s' while reading counter '%s'.", error ("coverage mismatch for function %qs while reading counter %qs.",
IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl)), IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl)),
ctr_names[counter]); ctr_names[counter]);
error ("checksum is %x instead of %x", entry->checksum, checksum); error ("checksum is %x instead of %x", entry->checksum, checksum);
@ -346,7 +346,7 @@ get_coverage_counts (unsigned counter, unsigned expected,
} }
else if (entry->summary.num != expected) else if (entry->summary.num != expected)
{ {
error ("coverage mismatch for function '%s' while reading counter '%s'.", error ("coverage mismatch for function %qs while reading counter %qs.",
IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl)), IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl)),
ctr_names[counter]); ctr_names[counter]);
error ("number of counters is %d instead of %d", entry->summary.num, expected); error ("number of counters is %d instead of %d", entry->summary.num, expected);
@ -564,7 +564,7 @@ coverage_end_function (void)
if (bbg_file_opened > 1 && gcov_is_error ()) if (bbg_file_opened > 1 && gcov_is_error ())
{ {
warning ("error writing `%s'", bbg_file_name); warning ("error writing %qs", bbg_file_name);
bbg_file_opened = -1; bbg_file_opened = -1;
} }

View file

@ -2921,7 +2921,7 @@ expand_builtin_eh_return_data_regno (tree arglist)
if (TREE_CODE (which) != INTEGER_CST) if (TREE_CODE (which) != INTEGER_CST)
{ {
error ("argument of `__builtin_eh_return_regno' must be constant"); error ("argument of %<__builtin_eh_return_regno%> must be constant");
return constm1_rtx; return constm1_rtx;
} }

View file

@ -4897,12 +4897,12 @@ fold_truthop (enum tree_code code, tree truth_type, tree lhs, tree rhs)
{ {
if (wanted_code == NE_EXPR) if (wanted_code == NE_EXPR)
{ {
warning ("`or' of unmatched not-equal tests is always 1"); warning ("%<or%> of unmatched not-equal tests is always 1");
return constant_boolean_node (true, truth_type); return constant_boolean_node (true, truth_type);
} }
else else
{ {
warning ("`and' of mutually exclusive equal-tests is always 0"); warning ("%<and%> of mutually exclusive equal-tests is always 0");
return constant_boolean_node (false, truth_type); return constant_boolean_node (false, truth_type);
} }
} }

View file

@ -831,7 +831,7 @@ assign_temp (tree type_or_decl, int keep, int memory_required,
if (decl && size == -1 if (decl && size == -1
&& TREE_CODE (TYPE_SIZE_UNIT (type)) == INTEGER_CST) && TREE_CODE (TYPE_SIZE_UNIT (type)) == INTEGER_CST)
{ {
error ("%Jsize of variable '%D' is too large", decl, decl); error ("%Jsize of variable %qD is too large", decl, decl);
size = 1; size = 1;
} }
@ -1432,7 +1432,7 @@ static void
instantiate_virtual_regs_lossage (rtx insn) instantiate_virtual_regs_lossage (rtx insn)
{ {
gcc_assert (asm_noperands (PATTERN (insn)) >= 0); gcc_assert (asm_noperands (PATTERN (insn)) >= 0);
error_for_asm (insn, "impossible constraint in `asm'"); error_for_asm (insn, "impossible constraint in %<asm%>");
delete_insn (insn); delete_insn (insn);
} }
/* Given a pointer to a piece of rtx and an optional pointer to the /* Given a pointer to a piece of rtx and an optional pointer to the
@ -3454,7 +3454,8 @@ setjmp_vars_warning (tree block)
&& DECL_RTL_SET_P (decl) && DECL_RTL_SET_P (decl)
&& REG_P (DECL_RTL (decl)) && REG_P (DECL_RTL (decl))
&& regno_clobbered_at_setjmp (REGNO (DECL_RTL (decl)))) && regno_clobbered_at_setjmp (REGNO (DECL_RTL (decl))))
warning ("%Jvariable '%D' might be clobbered by `longjmp' or `vfork'", warning ("%Jvariable %qD might be clobbered by %<longjmp%>"
" or %<vfork%>",
decl, decl); decl, decl);
} }
@ -3474,7 +3475,7 @@ setjmp_args_warning (void)
if (DECL_RTL (decl) != 0 if (DECL_RTL (decl) != 0
&& REG_P (DECL_RTL (decl)) && REG_P (DECL_RTL (decl))
&& regno_clobbered_at_setjmp (REGNO (DECL_RTL (decl)))) && regno_clobbered_at_setjmp (REGNO (DECL_RTL (decl))))
warning ("%Jargument '%D' might be clobbered by `longjmp' or `vfork'", warning ("%Jargument %qD might be clobbered by %<longjmp%> or %<vfork%>",
decl, decl); decl, decl);
} }
@ -4198,7 +4199,7 @@ do_warn_unused_parameter (tree fn)
decl; decl = TREE_CHAIN (decl)) decl; decl = TREE_CHAIN (decl))
if (!TREE_USED (decl) && TREE_CODE (decl) == PARM_DECL if (!TREE_USED (decl) && TREE_CODE (decl) == PARM_DECL
&& DECL_NAME (decl) && !DECL_ARTIFICIAL (decl)) && DECL_NAME (decl) && !DECL_ARTIFICIAL (decl))
warning ("%Junused parameter '%D'", decl, decl); warning ("%Junused parameter %qD", decl, decl);
} }
static GTY(()) rtx initial_trampoline; static GTY(()) rtx initial_trampoline;

View file

@ -22,6 +22,7 @@ Boston, MA 02111-1307, USA. */
#include "config.h" #include "config.h"
#include "system.h" #include "system.h"
#include "coretypes.h" #include "coretypes.h"
#include "intl.h"
#include "tm.h" #include "tm.h"
#include "toplev.h" #include "toplev.h"
#include "tree.h" #include "tree.h"
@ -512,16 +513,16 @@ lhd_print_error_function (diagnostic_context *context, const char *file)
pp_set_prefix (context->printer, new_prefix); pp_set_prefix (context->printer, new_prefix);
if (current_function_decl == NULL) if (current_function_decl == NULL)
pp_printf (context->printer, "At top level:"); pp_printf (context->printer, _("At top level:"));
else else
{ {
if (TREE_CODE (TREE_TYPE (current_function_decl)) == METHOD_TYPE) if (TREE_CODE (TREE_TYPE (current_function_decl)) == METHOD_TYPE)
pp_printf pp_printf
(context->printer, "In member function `%s':", (context->printer, _("In member function %qs:"),
lang_hooks.decl_printable_name (current_function_decl, 2)); lang_hooks.decl_printable_name (current_function_decl, 2));
else else
pp_printf pp_printf
(context->printer, "In function `%s':", (context->printer, _("In function %qs:"),
lang_hooks.decl_printable_name (current_function_decl, 2)); lang_hooks.decl_printable_name (current_function_decl, 2));
} }

View file

@ -73,5 +73,5 @@ set_param_value (const char *name, int value)
} }
/* If we didn't find this parameter, issue an error message. */ /* If we didn't find this parameter, issue an error message. */
error ("invalid parameter `%s'", name); error ("invalid parameter %qs", name);
} }

View file

@ -248,7 +248,17 @@ extern const char *pp_base_formatted_text (pretty_printer *);
extern const char *pp_base_last_position_in_text (const pretty_printer *); extern const char *pp_base_last_position_in_text (const pretty_printer *);
extern void pp_base_emit_prefix (pretty_printer *); extern void pp_base_emit_prefix (pretty_printer *);
extern void pp_base_append_text (pretty_printer *, const char *, const char *); extern void pp_base_append_text (pretty_printer *, const char *, const char *);
extern void pp_printf (pretty_printer *, const char *, ...) ATTRIBUTE_PRINTF_2;
/* This header may be included before toplev.h, hence the duplicate
definitions to allow for GCC-specific formats. */
#if GCC_VERSION >= 3005
#define ATTRIBUTE_GCC_PPDIAG(m, n) __attribute__ ((__format__ (__gcc_diag__, m ,n))) ATTRIBUTE_NONNULL(m)
#else
#define ATTRIBUTE_GCC_PPDIAG(m, n) ATTRIBUTE_NONNULL(m)
#endif
extern void pp_printf (pretty_printer *, const char *, ...)
ATTRIBUTE_GCC_PPDIAG(2,3);
extern void pp_verbatim (pretty_printer *, const char *, ...); extern void pp_verbatim (pretty_printer *, const char *, ...);
extern void pp_base_flush (pretty_printer *); extern void pp_base_flush (pretty_printer *);
extern void pp_base_format_text (pretty_printer *, text_info *); extern void pp_base_format_text (pretty_printer *, text_info *);

View file

@ -1254,7 +1254,8 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc,
mode = outmode; mode = outmode;
if (mode == VOIDmode) if (mode == VOIDmode)
{ {
error_for_asm (this_insn, "cannot reload integer constant operand in `asm'"); error_for_asm (this_insn, "cannot reload integer constant "
"operand in %<asm%>");
mode = word_mode; mode = word_mode;
if (in != 0) if (in != 0)
inmode = word_mode; inmode = word_mode;
@ -1276,7 +1277,8 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc,
} }
if (i == FIRST_PSEUDO_REGISTER) if (i == FIRST_PSEUDO_REGISTER)
{ {
error_for_asm (this_insn, "impossible register constraint in `asm'"); error_for_asm (this_insn, "impossible register constraint "
"in %<asm%>");
class = ALL_REGS; class = ALL_REGS;
} }
} }
@ -3513,7 +3515,7 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known,
this_alternative_earlyclobber[i] = 0; this_alternative_earlyclobber[i] = 0;
gcc_assert (this_insn_is_asm); gcc_assert (this_insn_is_asm);
error_for_asm (this_insn, error_for_asm (this_insn,
"`&' constraint used with no register class"); "%<&%> constraint used with no register class");
} }
for (j = 0; j < noperands; j++) for (j = 0; j < noperands; j++)
@ -3680,7 +3682,7 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known,
/* No alternative works with reloads?? */ /* No alternative works with reloads?? */
if (insn_code_number >= 0) if (insn_code_number >= 0)
fatal_insn ("unable to generate reloads for:", insn); fatal_insn ("unable to generate reloads for:", insn);
error_for_asm (insn, "inconsistent operand constraints in an `asm'"); error_for_asm (insn, "inconsistent operand constraints in an %<asm%>");
/* Avoid further trouble with this insn. */ /* Avoid further trouble with this insn. */
PATTERN (insn) = gen_rtx_USE (VOIDmode, const0_rtx); PATTERN (insn) = gen_rtx_USE (VOIDmode, const0_rtx);
n_reloads = 0; n_reloads = 0;
@ -3891,7 +3893,8 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known,
else else
{ {
gcc_assert (insn_code_number < 0); gcc_assert (insn_code_number < 0);
error_for_asm (insn, "inconsistent operand constraints in an `asm'"); error_for_asm (insn, "inconsistent operand constraints "
"in an %<asm%>");
/* Avoid further trouble with this insn. */ /* Avoid further trouble with this insn. */
PATTERN (insn) = gen_rtx_USE (VOIDmode, const0_rtx); PATTERN (insn) = gen_rtx_USE (VOIDmode, const0_rtx);
n_reloads = 0; n_reloads = 0;

View file

@ -1871,11 +1871,12 @@ spill_failure (rtx insn, enum reg_class class)
{ {
static const char *const reg_class_names[] = REG_CLASS_NAMES; static const char *const reg_class_names[] = REG_CLASS_NAMES;
if (asm_noperands (PATTERN (insn)) >= 0) if (asm_noperands (PATTERN (insn)) >= 0)
error_for_asm (insn, "can't find a register in class `%s' while reloading `asm'", error_for_asm (insn, "can't find a register in class %qs while "
"reloading %<asm%>",
reg_class_names[class]); reg_class_names[class]);
else else
{ {
error ("unable to find a register to spill in class `%s'", error ("unable to find a register to spill in class %qs",
reg_class_names[class]); reg_class_names[class]);
fatal_insn ("this is the insn:", insn); fatal_insn ("this is the insn:", insn);
} }
@ -3867,7 +3868,8 @@ reload_as_needed (int live_known)
|| (extract_insn (p), ! constrain_operands (1)))) || (extract_insn (p), ! constrain_operands (1))))
{ {
error_for_asm (insn, error_for_asm (insn,
"`asm' operand requires impossible reload"); "%<asm%> operand requires "
"impossible reload");
delete_insn (p); delete_insn (p);
} }
} }
@ -4990,7 +4992,7 @@ failed_reload (rtx insn, int r)
/* It's the user's fault; the operand's mode and constraint /* It's the user's fault; the operand's mode and constraint
don't match. Disable this reload so we don't crash in final. */ don't match. Disable this reload so we don't crash in final. */
error_for_asm (insn, error_for_asm (insn,
"`asm' operand constraint incompatible with operand size"); "%<asm%> operand constraint incompatible with operand size");
rld[r].in = 0; rld[r].in = 0;
rld[r].out = 0; rld[r].out = 0;
rld[r].reg_rtx = 0; rld[r].reg_rtx = 0;
@ -6609,7 +6611,7 @@ emit_output_reload_insns (struct insn_chain *chain, struct reload *rl,
if (asm_noperands (PATTERN (insn)) < 0) if (asm_noperands (PATTERN (insn)) < 0)
/* It's the compiler's fault. */ /* It's the compiler's fault. */
fatal_insn ("VOIDmode on an output", insn); fatal_insn ("VOIDmode on an output", insn);
error_for_asm (insn, "output operand is constant in `asm'"); error_for_asm (insn, "output operand is constant in %<asm%>");
/* Prevent crash--use something we know is valid. */ /* Prevent crash--use something we know is valid. */
mode = word_mode; mode = word_mode;
old = gen_rtx_REG (mode, REGNO (reloadreg)); old = gen_rtx_REG (mode, REGNO (reloadreg));

View file

@ -312,7 +312,7 @@ parse_output_constraint (const char **constraint_p, int operand_num,
message. */ message. */
if (!p) if (!p)
{ {
error ("output operand constraint lacks `='"); error ("output operand constraint lacks %<=%>");
return false; return false;
} }
@ -327,7 +327,8 @@ parse_output_constraint (const char **constraint_p, int operand_num,
size_t c_len = strlen (constraint); size_t c_len = strlen (constraint);
if (p != constraint) if (p != constraint)
warning ("output constraint `%c' for operand %d is not at the beginning", warning ("output constraint %qc for operand %d "
"is not at the beginning",
*p, operand_num); *p, operand_num);
/* Make a copy of the constraint. */ /* Make a copy of the constraint. */
@ -349,13 +350,14 @@ parse_output_constraint (const char **constraint_p, int operand_num,
{ {
case '+': case '+':
case '=': case '=':
error ("operand constraint contains incorrectly positioned '+' or '='"); error ("operand constraint contains incorrectly positioned "
"%<+%> or %<=%>");
return false; return false;
case '%': case '%':
if (operand_num + 1 == ninputs + noutputs) if (operand_num + 1 == ninputs + noutputs)
{ {
error ("`%%' constraint used with last operand"); error ("%<%%%> constraint used with last operand");
return false; return false;
} }
break; break;
@ -445,7 +447,7 @@ parse_input_constraint (const char **constraint_p, int input_num,
case '+': case '=': case '&': case '+': case '=': case '&':
if (constraint == orig_constraint) if (constraint == orig_constraint)
{ {
error ("input operand constraint contains `%c'", constraint[j]); error ("input operand constraint contains %qc", constraint[j]);
return false; return false;
} }
break; break;
@ -454,7 +456,7 @@ parse_input_constraint (const char **constraint_p, int input_num,
if (constraint == orig_constraint if (constraint == orig_constraint
&& input_num + 1 == ninputs - ninout) && input_num + 1 == ninputs - ninout)
{ {
error ("`%%' constraint used with last operand"); error ("%<%%%> constraint used with last operand");
return false; return false;
} }
break; break;
@ -525,7 +527,7 @@ parse_input_constraint (const char **constraint_p, int input_num,
default: default:
if (! ISALPHA (constraint[j])) if (! ISALPHA (constraint[j]))
{ {
error ("invalid punctuation `%c' in constraint", constraint[j]); error ("invalid punctuation %qc in constraint", constraint[j]);
return false; return false;
} }
if (REG_CLASS_FROM_CONSTRAINT (constraint[j], constraint + j) if (REG_CLASS_FROM_CONSTRAINT (constraint[j], constraint + j)
@ -604,7 +606,8 @@ decl_conflicts_with_clobbers_p (tree decl, const HARD_REG_SET clobbered_regs)
regno++) regno++)
if (TEST_HARD_REG_BIT (clobbered_regs, regno)) if (TEST_HARD_REG_BIT (clobbered_regs, regno))
{ {
error ("asm-specifier for variable `%s' conflicts with asm clobber list", error ("asm-specifier for variable %qs conflicts with "
"asm clobber list",
IDENTIFIER_POINTER (DECL_NAME (decl))); IDENTIFIER_POINTER (DECL_NAME (decl)));
/* Reset registerness to stop multiple errors emitted for a /* Reset registerness to stop multiple errors emitted for a
@ -692,7 +695,7 @@ expand_asm_operands (tree string, tree outputs, tree inputs,
if (i >= 0 || i == -4) if (i >= 0 || i == -4)
++nclobbers; ++nclobbers;
else if (i == -2) else if (i == -2)
error ("unknown register name `%s' in `asm'", regname); error ("unknown register name %qs in %<asm%>", regname);
/* Mark clobbered registers. */ /* Mark clobbered registers. */
if (i >= 0) if (i >= 0)
@ -700,7 +703,7 @@ expand_asm_operands (tree string, tree outputs, tree inputs,
/* Clobbering the PIC register is an error */ /* Clobbering the PIC register is an error */
if (i == (int) PIC_OFFSET_TABLE_REGNUM) if (i == (int) PIC_OFFSET_TABLE_REGNUM)
{ {
error ("PIC register `%s' clobbered in `asm'", regname); error ("PIC register %qs clobbered in %<asm%>", regname);
return; return;
} }
@ -747,7 +750,7 @@ expand_asm_operands (tree string, tree outputs, tree inputs,
ninputs += ninout; ninputs += ninout;
if (ninputs + noutputs > MAX_RECOG_OPERANDS) if (ninputs + noutputs > MAX_RECOG_OPERANDS)
{ {
error ("more than %d operands in `asm'", MAX_RECOG_OPERANDS); error ("more than %d operands in %<asm%>", MAX_RECOG_OPERANDS);
return; return;
} }
@ -889,7 +892,7 @@ expand_asm_operands (tree string, tree outputs, tree inputs,
if (allows_reg) if (allows_reg)
op = force_reg (TYPE_MODE (type), op); op = force_reg (TYPE_MODE (type), op);
else if (!allows_mem) else if (!allows_mem)
warning ("asm operand %d probably doesn't match constraints", warning ("asm operand %d probably doesn%'t match constraints",
i + noutputs); i + noutputs);
else if (MEM_P (op)) else if (MEM_P (op))
{ {
@ -1127,7 +1130,7 @@ check_operand_nalternatives (tree outputs, tree inputs)
if (nalternatives + 1 > MAX_RECOG_ALTERNATIVES) if (nalternatives + 1 > MAX_RECOG_ALTERNATIVES)
{ {
error ("too many alternatives in `asm'"); error ("too many alternatives in %<asm%>");
return false; return false;
} }
@ -1139,7 +1142,8 @@ check_operand_nalternatives (tree outputs, tree inputs)
if (n_occurrences (',', constraint) != nalternatives) if (n_occurrences (',', constraint) != nalternatives)
{ {
error ("operand constraints for `asm' differ in number of alternatives"); error ("operand constraints for %<asm%> differ "
"in number of alternatives");
return false; return false;
} }
@ -1191,7 +1195,7 @@ check_unique_operand_names (tree outputs, tree inputs)
return true; return true;
failure: failure:
error ("duplicate asm operand name '%s'", error ("duplicate asm operand name %qs",
TREE_STRING_POINTER (TREE_PURPOSE (TREE_PURPOSE (i)))); TREE_STRING_POINTER (TREE_PURPOSE (TREE_PURPOSE (i))));
return false; return false;
} }
@ -1317,7 +1321,7 @@ resolve_operand_name_1 (char *p, tree outputs, tree inputs)
} }
*q = '\0'; *q = '\0';
error ("undefined named operand '%s'", p + 1); error ("undefined named operand %qs", p + 1);
op = 0; op = 0;
found: found:

View file

@ -149,7 +149,7 @@ variable_size (tree size)
if (lang_hooks.decls.global_bindings_p ()) if (lang_hooks.decls.global_bindings_p ())
{ {
if (TREE_CONSTANT (size)) if (TREE_CONSTANT (size))
error ("type size can't be explicitly evaluated"); error ("type size can%'t be explicitly evaluated");
else else
error ("variable-size type declared outside of any function"); error ("variable-size type declared outside of any function");
@ -455,9 +455,9 @@ layout_decl (tree decl, unsigned int known_align)
int size_as_int = TREE_INT_CST_LOW (size); int size_as_int = TREE_INT_CST_LOW (size);
if (compare_tree_int (size, size_as_int) == 0) if (compare_tree_int (size, size_as_int) == 0)
warning ("%Jsize of '%D' is %d bytes", decl, decl, size_as_int); warning ("%Jsize of %qD is %d bytes", decl, decl, size_as_int);
else else
warning ("%Jsize of '%D' is larger than %d bytes", warning ("%Jsize of %qD is larger than %d bytes",
decl, decl, larger_than_size); decl, decl, larger_than_size);
} }
} }
@ -840,9 +840,9 @@ place_field (record_layout_info rli, tree field)
{ {
if (STRICT_ALIGNMENT) if (STRICT_ALIGNMENT)
warning ("%Jpacked attribute causes inefficient alignment " warning ("%Jpacked attribute causes inefficient alignment "
"for '%D'", field, field); "for %qD", field, field);
else else
warning ("%Jpacked attribute is unnecessary for '%D'", warning ("%Jpacked attribute is unnecessary for %qD",
field, field); field, field);
} }
} }
@ -858,7 +858,7 @@ place_field (record_layout_info rli, tree field)
Bump the cumulative size to multiple of field alignment. */ Bump the cumulative size to multiple of field alignment. */
if (warn_padded) if (warn_padded)
warning ("%Jpadding struct to align '%D'", field, field); warning ("%Jpadding struct to align %qD", field, field);
/* If the alignment is still within offset_align, just align /* If the alignment is still within offset_align, just align
the bit position. */ the bit position. */
@ -1230,9 +1230,10 @@ finalize_record_size (record_layout_info rli)
name = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (rli->t))); name = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (rli->t)));
if (STRICT_ALIGNMENT) if (STRICT_ALIGNMENT)
warning ("packed attribute causes inefficient alignment for `%s'", name); warning ("packed attribute causes inefficient "
"alignment for %qs", name);
else else
warning ("packed attribute is unnecessary for `%s'", name); warning ("packed attribute is unnecessary for %qs", name);
} }
else else
{ {

View file

@ -1,3 +1,9 @@
2004-09-15 Joseph S. Myers <jsm@polyomino.org.uk>
* g++.dg/ext/member-attr.C, g++.dg/warn/deprecated.C,
gcc.dg/deprecated.c, gcc.dg/noreturn-1.c, gcc.dg/noreturn-4.c:
Update expected messages.
2004-09-15 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de> 2004-09-15 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/16485 PR fortran/16485

View file

@ -9,6 +9,6 @@
class T { class T {
public: public:
__attribute__ ((garbage1)) void member1(int) {} /* { dg-error "`garbage1' attribute directive ignored" "" } */ __attribute__ ((garbage1)) void member1(int) {} /* { dg-error "'garbage1' attribute directive ignored" "" } */
void __attribute__ ((garbage2)) member2(int) {} /* { dg-error "`garbage2' attribute directive ignored" "" } */ void __attribute__ ((garbage2)) member2(int) {} /* { dg-error "'garbage2' attribute directive ignored" "" } */
}; };

View file

@ -6,18 +6,18 @@
typedef int INT1 __attribute__((deprecated)); typedef int INT1 __attribute__((deprecated));
typedef INT1 INT2 __attribute__ ((__deprecated__)); typedef INT1 INT2 __attribute__ ((__deprecated__));
typedef INT1 INT1a; /* { dg-warning "`INT1' is deprecated" "" } */ typedef INT1 INT1a; /* { dg-warning "'INT1' is deprecated" "" } */
typedef INT1 INT1b __attribute__ ((deprecated)); typedef INT1 INT1b __attribute__ ((deprecated));
INT1 should_be_unavailable; /* { dg-warning "`INT1' is deprecated" "" } */ INT1 should_be_unavailable; /* { dg-warning "'INT1' is deprecated" "" } */
INT1a should_not_be_deprecated; INT1a should_not_be_deprecated;
INT1 f1(void) __attribute__ ((deprecated)); INT1 f1(void) __attribute__ ((deprecated));
INT1 f2(void) { return 0; } /* { dg-warning "`INT1' is deprecated" "" } */ INT1 f2(void) { return 0; } /* { dg-warning "'INT1' is deprecated" "" } */
INT2 f3(void) __attribute__ ((__deprecated__)); INT2 f3(void) __attribute__ ((__deprecated__));
INT2 f4(void) { return 0; } /* { dg-warning "`INT2' is deprecated" "" } */ INT2 f4(void) { return 0; } /* { dg-warning "'INT2' is deprecated" "" } */
int f5(INT2 x); /* { dg-warning "`INT2' is deprecated" "" } */ int f5(INT2 x); /* { dg-warning "'INT2' is deprecated" "" } */
int f6(INT2 x) __attribute__ ((__deprecated__)); int f6(INT2 x) __attribute__ ((__deprecated__));
typedef enum Color {red, green, blue} Color __attribute__((deprecated)); typedef enum Color {red, green, blue} Color __attribute__((deprecated));
@ -25,7 +25,7 @@ typedef enum Color {red, green, blue} Color __attribute__((deprecated));
int g1; int g1;
int g2 __attribute__ ((deprecated)); int g2 __attribute__ ((deprecated));
int g3 __attribute__ ((__deprecated__)); int g3 __attribute__ ((__deprecated__));
Color k; /* { dg-warning "`Color' is deprecated" "" } */ Color k; /* { dg-warning "'Color' is deprecated" "" } */
typedef struct { typedef struct {
int field1; int field1;
@ -46,17 +46,17 @@ typedef struct {
int func1() int func1()
{ {
INT1 w; /* { dg-warning "`INT1' is deprecated" "" } */ INT1 w; /* { dg-warning "'INT1' is deprecated" "" } */
int x __attribute__ ((deprecated)); int x __attribute__ ((deprecated));
int y __attribute__ ((__deprecated__)); int y __attribute__ ((__deprecated__));
int z; int z;
int (*pf)() = f1; /* { dg-warning "`f1' is deprecated" "" } */ int (*pf)() = f1; /* { dg-warning "'f1' is deprecated" "" } */
z = w + x + y + g1 + g2 + g3; /* { dg-warning "`x' is deprecated" "" } */ z = w + x + y + g1 + g2 + g3; /* { dg-warning "'x' is deprecated" "" } */
/* { dg-warning "`y' is deprecated" "" { target *-*-* } 55 } */ /* { dg-warning "'y' is deprecated" "" { target *-*-* } 55 } */
/* { dg-warning "`g2' is deprecated" "" { target *-*-* } 55 } */ /* { dg-warning "'g2' is deprecated" "" { target *-*-* } 55 } */
/* { dg-warning "`g3' is deprecated" "" { target *-*-* } 55 } */ /* { dg-warning "'g3' is deprecated" "" { target *-*-* } 55 } */
return f1(); /* { dg-warning "`f1' is deprecated" "" } */ return f1(); /* { dg-warning "'f1' is deprecated" "" } */
} }
int func2(S1 *p) int func2(S1 *p)
@ -64,36 +64,36 @@ int func2(S1 *p)
S1 lp; S1 lp;
if (p->field1) if (p->field1)
return p->field2; /* { dg-warning "`field2' is deprecated" "" } */ return p->field2; /* { dg-warning "'field2' is deprecated" "" } */
else if (lp.field4) /* { dg-warning "`field4' is deprecated" "" } */ else if (lp.field4) /* { dg-warning "'field4' is deprecated" "" } */
return p->field3; return p->field3;
p->u1.field5 = g1 + p->field7; p->u1.field5 = g1 + p->field7;
p->u2.field9; /* { dg-warning "`u2' is deprecated" "" } */ p->u2.field9; /* { dg-warning "'u2' is deprecated" "" } */
return p->u1.field6 + p->field8; /* { dg-warning "`field6' is deprecated" "" } */ return p->u1.field6 + p->field8; /* { dg-warning "'field6' is deprecated" "" } */
/* { dg-warning "`field8' is deprecated" "" { target *-*-* } 73 } */ /* { dg-warning "'field8' is deprecated" "" { target *-*-* } 73 } */
} }
struct SS1 { struct SS1 {
int x; int x;
INT1 y; /* { dg-warning "`INT1' is deprecated" "" } */ INT1 y; /* { dg-warning "'INT1' is deprecated" "" } */
} __attribute__ ((deprecated)); } __attribute__ ((deprecated));
struct SS1 *p1; /* { dg-warning "`SS1' is deprecated" "" } */ struct SS1 *p1; /* { dg-warning "'SS1' is deprecated" "" } */
struct __attribute__ ((__deprecated__)) SS2 { struct __attribute__ ((__deprecated__)) SS2 {
int x; int x;
INT1 y; /* { dg-warning "`INT1' is deprecated" "" } */ INT1 y; /* { dg-warning "'INT1' is deprecated" "" } */
}; };
struct SS2 *p2; /* { dg-warning "`SS2' is deprecated" "" } */ struct SS2 *p2; /* { dg-warning "'SS2' is deprecated" "" } */
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
class T { class T {
public: public:
void member1(int) __attribute__ ((deprecated)); void member1(int) __attribute__ ((deprecated));
void member2(INT1) __attribute__ ((__deprecated__)); /* { dg-warning "`INT1' is deprecated" "" } */ void member2(INT1) __attribute__ ((__deprecated__)); /* { dg-warning "'INT1' is deprecated" "" } */
int member3(T *); int member3(T *);
int x; int x;
} __attribute__ ((deprecated)); } __attribute__ ((deprecated));
@ -104,13 +104,13 @@ inline void T::member1(int) {}
int T::member3(T *p) int T::member3(T *p)
{ {
p->member1(1); /* { dg-warning "`member1' is deprecated" "" } */ p->member1(1); /* { dg-warning "'member1' is deprecated" "" } */
(*p).member1(2); /* { dg-warning "`member1' is deprecated" "" } */ (*p).member1(2); /* { dg-warning "'member1' is deprecated" "" } */
p->member2(1); /* { dg-warning "`member2' is deprecated" "" } */ p->member2(1); /* { dg-warning "'member2' is deprecated" "" } */
(*p).member2(2); /* { dg-warning "`member2' is deprecated" "" } */ (*p).member2(2); /* { dg-warning "'member2' is deprecated" "" } */
p->member3(p); p->member3(p);
(*p).member3(p); (*p).member3(p);
return f1(); /* { dg-warning "`f1' is deprecated" "" } */ return f1(); /* { dg-warning "'f1' is deprecated" "" } */
} }
#endif #endif

View file

@ -6,26 +6,26 @@
typedef int INT1 __attribute__((deprecated)); typedef int INT1 __attribute__((deprecated));
typedef INT1 INT2 __attribute__ ((__deprecated__)); typedef INT1 INT2 __attribute__ ((__deprecated__));
typedef INT1 INT1a; /* { dg-warning "`INT1' is deprecated" "" } */ typedef INT1 INT1a; /* { dg-warning "'INT1' is deprecated" "" } */
typedef INT1 INT1b __attribute__ ((deprecated)); typedef INT1 INT1b __attribute__ ((deprecated));
INT1 should_be_unavailable; /* { dg-warning "`INT1' is deprecated" "" } */ INT1 should_be_unavailable; /* { dg-warning "'INT1' is deprecated" "" } */
INT1a should_not_be_deprecated; INT1a should_not_be_deprecated;
INT1 f1(void) __attribute__ ((deprecated)); INT1 f1(void) __attribute__ ((deprecated));
INT1 f2(void) { return 0; } /* { dg-warning "`INT1' is deprecated" "" } */ INT1 f2(void) { return 0; } /* { dg-warning "'INT1' is deprecated" "" } */
INT2 f3(void) __attribute__ ((__deprecated__)); INT2 f3(void) __attribute__ ((__deprecated__));
INT2 f4(void) { return 0; } /* { dg-warning "`INT2' is deprecated" "" } */ INT2 f4(void) { return 0; } /* { dg-warning "'INT2' is deprecated" "" } */
int f5(INT2 x); /* { dg-warning "`INT2' is deprecated" "" } */ int f5(INT2 x); /* { dg-warning "'INT2' is deprecated" "" } */
int f6(INT2 x) __attribute__ ((__deprecated__)); /* { dg-warning "`INT2' is deprecated" "" } */ int f6(INT2 x) __attribute__ ((__deprecated__)); /* { dg-warning "'INT2' is deprecated" "" } */
typedef enum {red, green, blue} Color __attribute__((deprecated)); typedef enum {red, green, blue} Color __attribute__((deprecated));
int g1; int g1;
int g2 __attribute__ ((deprecated)); int g2 __attribute__ ((deprecated));
int g3 __attribute__ ((__deprecated__)); int g3 __attribute__ ((__deprecated__));
Color k; /* { dg-warning "`Color' is deprecated" "" } */ Color k; /* { dg-warning "'Color' is deprecated" "" } */
typedef struct { typedef struct {
int field1; int field1;
@ -46,17 +46,17 @@ typedef struct {
int func1() int func1()
{ {
INT1 w; /* { dg-warning "`INT1' is deprecated" "" } */ INT1 w; /* { dg-warning "'INT1' is deprecated" "" } */
int x __attribute__ ((deprecated)); int x __attribute__ ((deprecated));
int y __attribute__ ((__deprecated__)); int y __attribute__ ((__deprecated__));
int z; int z;
int (*pf)() = f1; /* { dg-warning "`f1' is deprecated" "" } */ int (*pf)() = f1; /* { dg-warning "'f1' is deprecated" "" } */
z = w + x + y + g1 + g2 + g3; /* { dg-warning "`x' is deprecated" "" } */ z = w + x + y + g1 + g2 + g3; /* { dg-warning "'x' is deprecated" "" } */
/* { dg-warning "`y' is deprecated" "" { target *-*-* } 55 } */ /* { dg-warning "'y' is deprecated" "" { target *-*-* } 55 } */
/* { dg-warning "`g2' is deprecated" "" { target *-*-* } 55 } */ /* { dg-warning "'g2' is deprecated" "" { target *-*-* } 55 } */
/* { dg-warning "`g3' is deprecated" "" { target *-*-* } 55 } */ /* { dg-warning "'g3' is deprecated" "" { target *-*-* } 55 } */
return f1(); /* { dg-warning "`f1' is deprecated" "" } */ return f1(); /* { dg-warning "'f1' is deprecated" "" } */
} }
int func2(S1 *p) int func2(S1 *p)
@ -64,29 +64,29 @@ int func2(S1 *p)
S1 lp; S1 lp;
if (p->field1) if (p->field1)
return p->field2; /* { dg-warning "`field2' is deprecated" "" } */ return p->field2; /* { dg-warning "'field2' is deprecated" "" } */
else if (lp.field4) /* { dg-warning "`field4' is deprecated" "" } */ else if (lp.field4) /* { dg-warning "'field4' is deprecated" "" } */
return p->field3; return p->field3;
p->u1.field5 = g1 + p->field7; p->u1.field5 = g1 + p->field7;
p->u2.field9; /* { dg-warning "`u2' is deprecated" "" } */ p->u2.field9; /* { dg-warning "'u2' is deprecated" "" } */
return p->u1.field6 + p->field8; /* { dg-warning "`field6' is deprecated" "" } */ return p->u1.field6 + p->field8; /* { dg-warning "'field6' is deprecated" "" } */
/* { dg-warning "`field8' is deprecated" "" { target *-*-* } 73 } */ /* { dg-warning "'field8' is deprecated" "" { target *-*-* } 73 } */
} }
struct SS1 { struct SS1 {
int x; int x;
INT1 y; /* { dg-warning "`INT1' is deprecated" "" } */ INT1 y; /* { dg-warning "'INT1' is deprecated" "" } */
} __attribute__ ((deprecated)); } __attribute__ ((deprecated));
struct SS1 *p1; /* { dg-warning "`SS1' is deprecated" "" } */ struct SS1 *p1; /* { dg-warning "'SS1' is deprecated" "" } */
struct __attribute__ ((__deprecated__)) SS2 { struct __attribute__ ((__deprecated__)) SS2 {
int x; int x;
INT1 y; /* { dg-warning "`INT1' is deprecated" "" } */ INT1 y; /* { dg-warning "'INT1' is deprecated" "" } */
}; };
struct SS2 *p2; /* { dg-warning "`SS2' is deprecated" "" } */ struct SS2 *p2; /* { dg-warning "'SS2' is deprecated" "" } */
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
@ -104,13 +104,13 @@ inline void T::member1(int) {}
int T::member2(T *p) int T::member2(T *p)
{ {
p->member1(1); /* { xxdg-warning "`member1' is deprecated" "" } */ p->member1(1); /* { xxdg-warning "'member1' is deprecated" "" } */
(*p).member1(2); /* { xxdg-warning "`member1' is deprecated" "" } */ (*p).member1(2); /* { xxdg-warning "'member1' is deprecated" "" } */
p->member2(1); /* { xxdg-warning "`member2' is deprecated" "" } */ p->member2(1); /* { xxdg-warning "'member2' is deprecated" "" } */
(*p).member2(2); /* { xxdg-warning "`member2' is deprecated" "" } */ (*p).member2(2); /* { xxdg-warning "'member2' is deprecated" "" } */
p->member3(p); p->member3(p);
(*p).member3(p); (*p).member3(p);
return f1(); /* { xxdg-warning "`f1' is deprecated" "" } */ return f1(); /* { xxdg-warning "'f1' is deprecated" "" } */
} }
#endif #endif

View file

@ -8,7 +8,7 @@ extern void foo1(void) __attribute__ ((__noreturn__));
void void
foo1(void) foo1(void)
{ {
} /* { dg-warning "`noreturn' function does return" "detect falling off end of noreturn" } */ } /* { dg-warning "'noreturn' function does return" "detect falling off end of noreturn" } */
extern void foo2(void) __attribute__ ((__noreturn__)); extern void foo2(void) __attribute__ ((__noreturn__));
void void
@ -26,7 +26,7 @@ foo3(void)
extern void foo4(void); extern void foo4(void);
void void
foo4(void) foo4(void)
{ /* { dg-warning "candidate for attribute `noreturn'" "detect noreturn candidate" } */ { /* { dg-warning "candidate for attribute 'noreturn'" "detect noreturn candidate" } */
exit(0); exit(0);
} }
@ -56,4 +56,4 @@ void
foo8(void) foo8(void)
{ {
foo7(); foo7();
} /* { dg-warning "`noreturn' function does return" "detect return from tail call" } */ } /* { dg-warning "'noreturn' function does return" "detect return from tail call" } */

View file

@ -5,6 +5,6 @@ extern void exit (int) __attribute__ ((__noreturn__));
int int
main (void) main (void)
{ /* { dg-warning "warning: function might be possible candidate for attribute `noreturn'" "warn for main" } */ { /* { dg-warning "warning: function might be possible candidate for attribute 'noreturn'" "warn for main" } */
exit (0); exit (0);
} }

View file

@ -534,7 +534,7 @@ read_integral_parameter (const char *p, const char *pname, const int defval)
if (*endp != 0) if (*endp != 0)
{ {
if (pname != 0) if (pname != 0)
error ("invalid option argument `%s'", pname); error ("invalid option argument %qs", pname);
return defval; return defval;
} }
@ -840,9 +840,10 @@ check_global_declarations (tree *vec, int len)
|| TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))) || TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))))
{ {
if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))) if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
pedwarn ("%J'%F' used but never defined", decl, decl); pedwarn ("%J%qF used but never defined", decl, decl);
else else
warning ("%J'%F' declared `static' but never defined", decl, decl); warning ("%J%qF declared %<static%> but never defined",
decl, decl);
/* This symbol is effectively an "extern" declaration now. */ /* This symbol is effectively an "extern" declaration now. */
TREE_PUBLIC (decl) = 1; TREE_PUBLIC (decl) = 1;
assemble_external (decl); assemble_external (decl);
@ -867,7 +868,7 @@ check_global_declarations (tree *vec, int len)
&& ! (TREE_CODE (decl) == VAR_DECL && DECL_REGISTER (decl)) && ! (TREE_CODE (decl) == VAR_DECL && DECL_REGISTER (decl))
/* Otherwise, ask the language. */ /* Otherwise, ask the language. */
&& lang_hooks.decls.warn_unused_global (decl)) && lang_hooks.decls.warn_unused_global (decl))
warning ("%J'%D' defined but not used", decl, decl); warning ("%J%qD defined but not used", decl, decl);
/* Avoid confusing the debug information machinery when there are /* Avoid confusing the debug information machinery when there are
errors. */ errors. */
@ -890,7 +891,7 @@ warn_deprecated_use (tree node)
if (DECL_P (node)) if (DECL_P (node))
{ {
expanded_location xloc = expand_location (DECL_SOURCE_LOCATION (node)); expanded_location xloc = expand_location (DECL_SOURCE_LOCATION (node));
warning ("`%s' is deprecated (declared at %s:%d)", warning ("%qs is deprecated (declared at %s:%d)",
IDENTIFIER_POINTER (DECL_NAME (node)), IDENTIFIER_POINTER (DECL_NAME (node)),
xloc.file, xloc.line); xloc.file, xloc.line);
} }
@ -913,7 +914,7 @@ warn_deprecated_use (tree node)
expanded_location xloc expanded_location xloc
= expand_location (DECL_SOURCE_LOCATION (decl)); = expand_location (DECL_SOURCE_LOCATION (decl));
if (what) if (what)
warning ("`%s' is deprecated (declared at %s:%d)", what, warning ("%qs is deprecated (declared at %s:%d)", what,
xloc.file, xloc.line); xloc.file, xloc.line);
else else
warning ("type is deprecated (declared at %s:%d)", warning ("type is deprecated (declared at %s:%d)",
@ -922,7 +923,7 @@ warn_deprecated_use (tree node)
else else
{ {
if (what) if (what)
warning ("`%s' is deprecated", what); warning ("%qs is deprecated", what);
else else
warning ("type is deprecated"); warning ("type is deprecated");
} }
@ -1216,7 +1217,7 @@ set_target_switch (const char *name)
#endif #endif
if (!valid_target_option) if (!valid_target_option)
error ("invalid option `%s'", name); error ("invalid option %qs", name);
} }
/* Print version information to FILE. /* Print version information to FILE.
@ -1393,7 +1394,7 @@ init_asm_output (const char *name)
else else
asm_out_file = fopen (asm_file_name, "w+b"); asm_out_file = fopen (asm_file_name, "w+b");
if (asm_out_file == 0) if (asm_out_file == 0)
fatal_error ("can't open %s for writing: %m", asm_file_name); fatal_error ("can%'t open %s for writing: %m", asm_file_name);
} }
#ifdef IO_BUFFER_SIZE #ifdef IO_BUFFER_SIZE
@ -1529,7 +1530,7 @@ default_pch_valid_p (const void *data_p, size_t len)
make_message: make_message:
{ {
char *r; char *r;
asprintf (&r, _("created and used with differing settings of `-m%s'"), asprintf (&r, _("created and used with differing settings of '-m%s'"),
flag_that_differs); flag_that_differs);
if (r == NULL) if (r == NULL)
return _("out of memory"); return _("out of memory");
@ -1861,7 +1862,7 @@ process_options (void)
{ {
aux_info_file = fopen (aux_info_file_name, "w"); aux_info_file = fopen (aux_info_file_name, "w");
if (aux_info_file == 0) if (aux_info_file == 0)
fatal_error ("can't open %s: %m", aux_info_file_name); fatal_error ("can%'t open %s: %m", aux_info_file_name);
} }
if (! targetm.have_named_sections) if (! targetm.have_named_sections)

View file

@ -3274,7 +3274,7 @@ verify_stmt (tree stmt, bool last_in_block)
{ {
if (!tree_could_throw_p (stmt)) if (!tree_could_throw_p (stmt))
{ {
error ("Statement marked for throw, but doesn't."); error ("Statement marked for throw, but doesn%'t.");
goto fail; goto fail;
} }
if (!last_in_block && tree_can_throw_internal (stmt)) if (!last_in_block && tree_can_throw_internal (stmt))
@ -3555,7 +3555,7 @@ tree_verify_flow_info (void)
if (!has_label_p (true_edge->dest, if (!has_label_p (true_edge->dest,
GOTO_DESTINATION (COND_EXPR_THEN (stmt)))) GOTO_DESTINATION (COND_EXPR_THEN (stmt))))
{ {
error ("`then' label does not match edge at end of bb %d\n", error ("%<then%> label does not match edge at end of bb %d\n",
bb->index); bb->index);
err = 1; err = 1;
} }
@ -3563,7 +3563,7 @@ tree_verify_flow_info (void)
if (!has_label_p (false_edge->dest, if (!has_label_p (false_edge->dest,
GOTO_DESTINATION (COND_EXPR_ELSE (stmt)))) GOTO_DESTINATION (COND_EXPR_ELSE (stmt))))
{ {
error ("`else' label does not match edge at end of bb %d\n", error ("%<else%> label does not match edge at end of bb %d\n",
bb->index); bb->index);
err = 1; err = 1;
} }
@ -4842,7 +4842,8 @@ execute_warn_function_return (void)
&& !TREE_THIS_VOLATILE (cfun->decl) && !TREE_THIS_VOLATILE (cfun->decl)
&& EXIT_BLOCK_PTR->pred == NULL && EXIT_BLOCK_PTR->pred == NULL
&& !lang_hooks.function.missing_noreturn_ok_p (cfun->decl)) && !lang_hooks.function.missing_noreturn_ok_p (cfun->decl))
warning ("%Jfunction might be possible candidate for attribute `noreturn'", warning ("%Jfunction might be possible candidate for "
"attribute %<noreturn%>",
cfun->decl); cfun->decl);
/* If we have a path to EXIT, then we do return. */ /* If we have a path to EXIT, then we do return. */
@ -4868,11 +4869,11 @@ execute_warn_function_return (void)
#ifdef USE_MAPPED_LOCATION #ifdef USE_MAPPED_LOCATION
if (location == UNKNOWN_LOCATION) if (location == UNKNOWN_LOCATION)
location = cfun->function_end_locus; location = cfun->function_end_locus;
warning ("%H`noreturn' function does return", &location); warning ("%H%<noreturn%> function does return", &location);
#else #else
if (!locus) if (!locus)
locus = &cfun->function_end_locus; locus = &cfun->function_end_locus;
warning ("%H`noreturn' function does return", locus); warning ("%H%<noreturn%> function does return", locus);
#endif #endif
} }

View file

@ -842,7 +842,7 @@ dump_begin (enum tree_dump_index phase, int *flag_ptr)
dfi = get_dump_file_info (phase); dfi = get_dump_file_info (phase);
stream = fopen (name, dfi->state < 0 ? "w" : "a"); stream = fopen (name, dfi->state < 0 ? "w" : "a");
if (!stream) if (!stream)
error ("could not open dump file `%s': %s", name, strerror (errno)); error ("could not open dump file %qs: %s", name, strerror (errno));
else else
dfi->state = 1; dfi->state = 1;
free (name); free (name);
@ -955,7 +955,7 @@ dump_switch_p_1 (const char *arg, struct dump_file_info *dfi)
flags |= option_ptr->value; flags |= option_ptr->value;
goto found; goto found;
} }
warning ("ignoring unknown option `%.*s' in `-fdump-%s'", warning ("ignoring unknown option %q.*s in %<-fdump-%s%>",
length, ptr, dfi->swtch); length, ptr, dfi->swtch);
found:; found:;
ptr = end_ptr; ptr = end_ptr;

View file

@ -1160,7 +1160,7 @@ mudflap_enqueue_decl (tree obj)
for (i = 0; i < VARRAY_ACTIVE_SIZE (deferred_static_decls); i++) for (i = 0; i < VARRAY_ACTIVE_SIZE (deferred_static_decls); i++)
if (VARRAY_TREE (deferred_static_decls, i) == obj) if (VARRAY_TREE (deferred_static_decls, i) == obj)
{ {
warning ("mudflap cannot track lifetime of `%s'", warning ("mudflap cannot track lifetime of %qs",
IDENTIFIER_POINTER (DECL_NAME (obj))); IDENTIFIER_POINTER (DECL_NAME (obj)));
return; return;
} }

View file

@ -3072,7 +3072,7 @@ handle_dll_attribute (tree * pnode, tree name, tree args, int flags,
} }
if (TREE_CODE (node) != RECORD_TYPE && TREE_CODE (node) != UNION_TYPE) if (TREE_CODE (node) != RECORD_TYPE && TREE_CODE (node) != UNION_TYPE)
{ {
warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name)); warning ("%qs attribute ignored", IDENTIFIER_POINTER (name));
*no_add_attrs = true; *no_add_attrs = true;
} }
@ -3090,7 +3090,7 @@ handle_dll_attribute (tree * pnode, tree name, tree args, int flags,
if (TREE_CODE (node) == FUNCTION_DECL && DECL_INITIAL (node) if (TREE_CODE (node) == FUNCTION_DECL && DECL_INITIAL (node)
&& !DECL_DECLARED_INLINE_P (node)) && !DECL_DECLARED_INLINE_P (node))
{ {
error ("%Jfunction `%D' definition is marked dllimport.", node, node); error ("%Jfunction %qD definition is marked dllimport.", node, node);
*no_add_attrs = true; *no_add_attrs = true;
} }
@ -3098,7 +3098,7 @@ handle_dll_attribute (tree * pnode, tree name, tree args, int flags,
{ {
if (DECL_INITIAL (node)) if (DECL_INITIAL (node))
{ {
error ("%Jvariable `%D' definition is marked dllimport.", error ("%Jvariable %qD definition is marked dllimport.",
node, node); node, node);
*no_add_attrs = true; *no_add_attrs = true;
} }
@ -3118,8 +3118,8 @@ handle_dll_attribute (tree * pnode, tree name, tree args, int flags,
&& (TREE_CODE (node) == VAR_DECL && (TREE_CODE (node) == VAR_DECL
|| TREE_CODE (node) == FUNCTION_DECL)) || TREE_CODE (node) == FUNCTION_DECL))
{ {
error ("%Jexternal linkage required for symbol '%D' because of " error ("%Jexternal linkage required for symbol %qD because of "
"'%s' attribute.", node, node, IDENTIFIER_POINTER (name)); "%qs attribute.", node, node, IDENTIFIER_POINTER (name));
*no_add_attrs = true; *no_add_attrs = true;
} }
@ -5316,7 +5316,7 @@ tree_class_check_failed (const tree node, int cl, const char *file,
int line, const char *function) int line, const char *function)
{ {
internal_error internal_error
("tree check: expected class '%c', have '%c' (%s) in %s, at %s:%d", ("tree check: expected class %qc, have %qc (%s) in %s, at %s:%d",
cl, TREE_CODE_CLASS (TREE_CODE (node)), cl, TREE_CODE_CLASS (TREE_CODE (node)),
tree_code_name[TREE_CODE (node)], function, trim_filename (file), line); tree_code_name[TREE_CODE (node)], function, trim_filename (file), line);
} }

View file

@ -897,14 +897,14 @@ make_decl_rtl (tree decl)
{ {
/* First detect errors in declaring global registers. */ /* First detect errors in declaring global registers. */
if (reg_number == -1) if (reg_number == -1)
error ("%Jregister name not specified for '%D'", decl, decl); error ("%Jregister name not specified for %qD", decl, decl);
else if (reg_number < 0) else if (reg_number < 0)
error ("%Jinvalid register name for '%D'", decl, decl); error ("%Jinvalid register name for %qD", decl, decl);
else if (TYPE_MODE (TREE_TYPE (decl)) == BLKmode) else if (TYPE_MODE (TREE_TYPE (decl)) == BLKmode)
error ("%Jdata type of '%D' isn't suitable for a register", error ("%Jdata type of %qD isn%'t suitable for a register",
decl, decl); decl, decl);
else if (! HARD_REGNO_MODE_OK (reg_number, TYPE_MODE (TREE_TYPE (decl)))) else if (! HARD_REGNO_MODE_OK (reg_number, TYPE_MODE (TREE_TYPE (decl))))
error ("%Jregister specified for '%D' isn't suitable for data type", error ("%Jregister specified for %qD isn%'t suitable for data type",
decl, decl); decl, decl);
/* Now handle properly declared static register variables. */ /* Now handle properly declared static register variables. */
else else
@ -917,7 +917,8 @@ make_decl_rtl (tree decl)
error ("global register variable has initial value"); error ("global register variable has initial value");
} }
if (TREE_THIS_VOLATILE (decl)) if (TREE_THIS_VOLATILE (decl))
warning ("volatile register variables don't work as you might wish"); warning ("volatile register variables don%'t "
"work as you might wish");
/* If the user specified one of the eliminables registers here, /* If the user specified one of the eliminables registers here,
e.g., FRAME_POINTER_REGNUM, we don't want to get this variable e.g., FRAME_POINTER_REGNUM, we don't want to get this variable
@ -949,7 +950,7 @@ make_decl_rtl (tree decl)
Also handle vars declared register invalidly. */ Also handle vars declared register invalidly. */
if (name[0] == '*' && (reg_number >= 0 || reg_number == -3)) if (name[0] == '*' && (reg_number >= 0 || reg_number == -3))
error ("%Jregister name given for non-register variable '%D'", decl, decl); error ("%Jregister name given for non-register variable %qD", decl, decl);
/* Specifying a section attribute on a variable forces it into a /* Specifying a section attribute on a variable forces it into a
non-.bss section, and thus it cannot be common. */ non-.bss section, and thus it cannot be common. */
@ -1519,7 +1520,7 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
if (!dont_output_data && DECL_SIZE (decl) == 0) if (!dont_output_data && DECL_SIZE (decl) == 0)
{ {
error ("%Jstorage size of `%D' isn't known", decl, decl); error ("%Jstorage size of %qD isn%'t known", decl, decl);
TREE_ASM_WRITTEN (decl) = 1; TREE_ASM_WRITTEN (decl) = 1;
return; return;
} }
@ -1547,7 +1548,7 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
if (! dont_output_data if (! dont_output_data
&& ! host_integerp (DECL_SIZE_UNIT (decl), 1)) && ! host_integerp (DECL_SIZE_UNIT (decl), 1))
{ {
error ("%Jsize of variable '%D' is too large", decl, decl); error ("%Jsize of variable %qD is too large", decl, decl);
return; return;
} }
@ -1570,7 +1571,7 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
In particular, a.out format supports a maximum alignment of 4. */ In particular, a.out format supports a maximum alignment of 4. */
if (align > MAX_OFILE_ALIGNMENT) if (align > MAX_OFILE_ALIGNMENT)
{ {
warning ("%Jalignment of '%D' is greater than maximum object " warning ("%Jalignment of %qD is greater than maximum object "
"file alignment. Using %d", decl, decl, "file alignment. Using %d", decl, decl,
MAX_OFILE_ALIGNMENT/BITS_PER_UNIT); MAX_OFILE_ALIGNMENT/BITS_PER_UNIT);
align = MAX_OFILE_ALIGNMENT; align = MAX_OFILE_ALIGNMENT;
@ -1644,7 +1645,7 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
#if !defined(ASM_OUTPUT_ALIGNED_COMMON) && !defined(ASM_OUTPUT_ALIGNED_DECL_COMMON) && !defined(ASM_OUTPUT_ALIGNED_BSS) #if !defined(ASM_OUTPUT_ALIGNED_COMMON) && !defined(ASM_OUTPUT_ALIGNED_DECL_COMMON) && !defined(ASM_OUTPUT_ALIGNED_BSS)
if ((unsigned HOST_WIDE_INT) DECL_ALIGN_UNIT (decl) > rounded) if ((unsigned HOST_WIDE_INT) DECL_ALIGN_UNIT (decl) > rounded)
warning ("%Jrequested alignment for '%D' is greater than " warning ("%Jrequested alignment for %qD is greater than "
"implemented alignment of %d", decl, decl, rounded); "implemented alignment of %d", decl, decl, rounded);
#endif #endif
@ -4011,7 +4012,7 @@ output_constructor (tree exp, unsigned HOST_WIDE_INT size,
total_bytes += fieldsize; total_bytes += fieldsize;
} }
else if (val != 0 && TREE_CODE (val) != INTEGER_CST) else if (val != 0 && TREE_CODE (val) != INTEGER_CST)
error ("invalid initial value for member `%s'", error ("invalid initial value for member %qs",
IDENTIFIER_POINTER (DECL_NAME (field))); IDENTIFIER_POINTER (DECL_NAME (field)));
else else
{ {
@ -4198,7 +4199,7 @@ merge_weak (tree newdecl, tree olddecl)
declare_weak because the NEWDECL and OLDDECL was not yet declare_weak because the NEWDECL and OLDDECL was not yet
been merged; therefore, TREE_ASM_WRITTEN was not set. */ been merged; therefore, TREE_ASM_WRITTEN was not set. */
if (TREE_ASM_WRITTEN (olddecl)) if (TREE_ASM_WRITTEN (olddecl))
error ("%Jweak declaration of '%D' must precede definition", error ("%Jweak declaration of %qD must precede definition",
newdecl, newdecl); newdecl, newdecl);
/* If we've already generated rtl referencing OLDDECL, we may /* If we've already generated rtl referencing OLDDECL, we may
@ -4206,7 +4207,7 @@ merge_weak (tree newdecl, tree olddecl)
a weak symbol. */ a weak symbol. */
else if (TREE_USED (olddecl) else if (TREE_USED (olddecl)
&& TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (olddecl))) && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (olddecl)))
warning ("%Jweak declaration of '%D' after first use results " warning ("%Jweak declaration of %qD after first use results "
"in unspecified behavior", newdecl, newdecl); "in unspecified behavior", newdecl, newdecl);
if (SUPPORTS_WEAK) if (SUPPORTS_WEAK)
@ -4240,16 +4241,16 @@ void
declare_weak (tree decl) declare_weak (tree decl)
{ {
if (! TREE_PUBLIC (decl)) if (! TREE_PUBLIC (decl))
error ("%Jweak declaration of '%D' must be public", decl, decl); error ("%Jweak declaration of %qD must be public", decl, decl);
else if (TREE_CODE (decl) == FUNCTION_DECL && TREE_ASM_WRITTEN (decl)) else if (TREE_CODE (decl) == FUNCTION_DECL && TREE_ASM_WRITTEN (decl))
error ("%Jweak declaration of '%D' must precede definition", decl, decl); error ("%Jweak declaration of %qD must precede definition", decl, decl);
else if (SUPPORTS_WEAK) else if (SUPPORTS_WEAK)
{ {
if (! DECL_WEAK (decl)) if (! DECL_WEAK (decl))
weak_decls = tree_cons (NULL, decl, weak_decls); weak_decls = tree_cons (NULL, decl, weak_decls);
} }
else else
warning ("%Jweak declaration of '%D' not supported", decl, decl); warning ("%Jweak declaration of %qD not supported", decl, decl);
mark_weak (decl); mark_weak (decl);
} }

View file

@ -1,3 +1,7 @@
2004-09-15 Joseph S. Myers <jsm@polyomino.org.uk>
* testsuite/libmudflap.c/pass35-frag.c: Update expected message.
2004-09-07 Frank Ch. Eigler <fche@redhat.com> 2004-09-07 Frank Ch. Eigler <fche@redhat.com>
* configure.ac: Look for pwd.h, grp.h, netdb.h headers and functions. * configure.ac: Look for pwd.h, grp.h, netdb.h headers and functions.

View file

@ -3,7 +3,7 @@
#include <string.h> #include <string.h>
extern char end []; /* Any old symbol we're sure will be defined. */ extern char end []; /* Any old symbol we're sure will be defined. */
/* { dg-warning "cannot track lifetime of `end'" "cannot track lifetime" { target *-*-* } 0 } */ /* { dg-warning "cannot track lifetime of 'end'" "cannot track lifetime" { target *-*-* } 0 } */
int main () int main ()
{ {