Commit c51a1ba9 by Joseph Myers Committed by Joseph Myers

c-common.c, [...]: Use %D for declarations in diagnostics and %E for identifiers, not %s.

	* c-common.c, c-decl.c, c-format.c, c-typeck.c: Use %D for
	declarations in diagnostics and %E for identifiers, not %s.

From-SVN: r96701
parent 33156717
2005-03-18 Joseph S. Myers <joseph@codesourcery.com>
* c-common.c, c-decl.c, c-format.c, c-typeck.c: Use %D for
declarations in diagnostics and %E for identifiers, not %s.
2005-03-18 Jan Hubicka <jh@suse.cz> 2005-03-18 Jan Hubicka <jh@suse.cz>
Dale Johannesen <dalej@apple.com> Dale Johannesen <dalej@apple.com>
......
...@@ -1146,8 +1146,7 @@ warn_for_collisions_1 (tree written, tree writer, struct tlist *list, ...@@ -1146,8 +1146,7 @@ warn_for_collisions_1 (tree written, tree writer, struct tlist *list,
&& DECL_NAME (list->expr)) && DECL_NAME (list->expr))
{ {
warned_ids = new_tlist (warned_ids, written, NULL_TREE); warned_ids = new_tlist (warned_ids, written, NULL_TREE);
warning ("operation on %qs may be undefined", warning ("operation on %qE may be undefined", list->expr);
IDENTIFIER_POINTER (DECL_NAME (list->expr)));
} }
list = list->next; list = list->next;
} }
...@@ -3958,7 +3957,7 @@ handle_packed_attribute (tree *node, tree name, tree ARG_UNUSED (args), ...@@ -3958,7 +3957,7 @@ handle_packed_attribute (tree *node, tree name, tree ARG_UNUSED (args),
that changes what the typedef is typing. */ that changes what the typedef is typing. */
else else
{ {
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); warning ("%qE attribute ignored", name);
*no_add_attrs = true; *no_add_attrs = true;
} }
...@@ -3977,7 +3976,7 @@ handle_nocommon_attribute (tree *node, tree name, ...@@ -3977,7 +3976,7 @@ handle_nocommon_attribute (tree *node, tree name,
DECL_COMMON (*node) = 0; DECL_COMMON (*node) = 0;
else else
{ {
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); warning ("%qE attribute ignored", name);
*no_add_attrs = true; *no_add_attrs = true;
} }
...@@ -3995,7 +3994,7 @@ handle_common_attribute (tree *node, tree name, tree ARG_UNUSED (args), ...@@ -3995,7 +3994,7 @@ handle_common_attribute (tree *node, tree name, tree ARG_UNUSED (args),
DECL_COMMON (*node) = 1; DECL_COMMON (*node) = 1;
else else
{ {
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); warning ("%qE attribute ignored", name);
*no_add_attrs = true; *no_add_attrs = true;
} }
...@@ -4022,7 +4021,7 @@ handle_noreturn_attribute (tree *node, tree name, tree ARG_UNUSED (args), ...@@ -4022,7 +4021,7 @@ handle_noreturn_attribute (tree *node, tree name, tree ARG_UNUSED (args),
TYPE_READONLY (TREE_TYPE (type)), 1)); TYPE_READONLY (TREE_TYPE (type)), 1));
else else
{ {
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); warning ("%qE attribute ignored", name);
*no_add_attrs = true; *no_add_attrs = true;
} }
...@@ -4041,7 +4040,7 @@ handle_noinline_attribute (tree *node, tree name, ...@@ -4041,7 +4040,7 @@ handle_noinline_attribute (tree *node, tree name,
DECL_UNINLINABLE (*node) = 1; DECL_UNINLINABLE (*node) = 1;
else else
{ {
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); warning ("%qE attribute ignored", name);
*no_add_attrs = true; *no_add_attrs = true;
} }
...@@ -4064,7 +4063,7 @@ handle_always_inline_attribute (tree *node, tree name, ...@@ -4064,7 +4063,7 @@ handle_always_inline_attribute (tree *node, tree name,
} }
else else
{ {
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); warning ("%qE attribute ignored", name);
*no_add_attrs = true; *no_add_attrs = true;
} }
...@@ -4088,7 +4087,7 @@ handle_used_attribute (tree *pnode, tree name, tree ARG_UNUSED (args), ...@@ -4088,7 +4087,7 @@ handle_used_attribute (tree *pnode, tree name, tree ARG_UNUSED (args),
} }
else else
{ {
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); warning ("%qE attribute ignored", name);
*no_add_attrs = true; *no_add_attrs = true;
} }
...@@ -4114,7 +4113,7 @@ handle_unused_attribute (tree *node, tree name, tree ARG_UNUSED (args), ...@@ -4114,7 +4113,7 @@ handle_unused_attribute (tree *node, tree name, tree ARG_UNUSED (args),
TREE_USED (decl) = 1; TREE_USED (decl) = 1;
else else
{ {
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); warning ("%qE attribute ignored", name);
*no_add_attrs = true; *no_add_attrs = true;
} }
} }
...@@ -4148,7 +4147,7 @@ handle_const_attribute (tree *node, tree name, tree ARG_UNUSED (args), ...@@ -4148,7 +4147,7 @@ handle_const_attribute (tree *node, tree name, tree ARG_UNUSED (args),
TREE_THIS_VOLATILE (TREE_TYPE (type)))); TREE_THIS_VOLATILE (TREE_TYPE (type))));
else else
{ {
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); warning ("%qE attribute ignored", name);
*no_add_attrs = true; *no_add_attrs = true;
} }
...@@ -4192,7 +4191,7 @@ handle_transparent_union_attribute (tree *node, tree name, ...@@ -4192,7 +4191,7 @@ handle_transparent_union_attribute (tree *node, tree name,
DECL_TRANSPARENT_UNION (decl) = 1; DECL_TRANSPARENT_UNION (decl) = 1;
else else
{ {
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); warning ("%qE attribute ignored", name);
*no_add_attrs = true; *no_add_attrs = true;
} }
...@@ -4220,7 +4219,7 @@ handle_constructor_attribute (tree *node, tree name, ...@@ -4220,7 +4219,7 @@ handle_constructor_attribute (tree *node, tree name,
} }
else else
{ {
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); warning ("%qE attribute ignored", name);
*no_add_attrs = true; *no_add_attrs = true;
} }
...@@ -4248,7 +4247,7 @@ handle_destructor_attribute (tree *node, tree name, ...@@ -4248,7 +4247,7 @@ handle_destructor_attribute (tree *node, tree name,
} }
else else
{ {
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); warning ("%qE attribute ignored", name);
*no_add_attrs = true; *no_add_attrs = true;
} }
...@@ -4267,7 +4266,7 @@ handle_mode_attribute (tree *node, tree name, tree args, ...@@ -4267,7 +4266,7 @@ handle_mode_attribute (tree *node, tree name, tree args,
*no_add_attrs = true; *no_add_attrs = true;
if (TREE_CODE (TREE_VALUE (args)) != IDENTIFIER_NODE) if (TREE_CODE (TREE_VALUE (args)) != IDENTIFIER_NODE)
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); warning ("%qE attribute ignored", name);
else else
{ {
int j; int j;
...@@ -4598,7 +4597,7 @@ handle_alias_attribute (tree *node, tree name, tree args, ...@@ -4598,7 +4597,7 @@ handle_alias_attribute (tree *node, tree name, tree args,
} }
else else
{ {
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); warning ("%qE attribute ignored", name);
*no_add_attrs = true; *no_add_attrs = true;
} }
...@@ -4622,14 +4621,13 @@ handle_visibility_attribute (tree *node, tree name, tree args, ...@@ -4622,14 +4621,13 @@ handle_visibility_attribute (tree *node, tree name, tree args,
{ {
if (TREE_CODE (*node) != RECORD_TYPE && TREE_CODE (*node) != UNION_TYPE) if (TREE_CODE (*node) != RECORD_TYPE && TREE_CODE (*node) != UNION_TYPE)
{ {
warning ("%qs attribute ignored on non-class types", warning ("%qE attribute ignored on non-class types", name);
IDENTIFIER_POINTER (name));
return NULL_TREE; return NULL_TREE;
} }
} }
else if (decl_function_context (decl) != 0 || !TREE_PUBLIC (decl)) else if (decl_function_context (decl) != 0 || !TREE_PUBLIC (decl))
{ {
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); warning ("%qE attribute ignored", name);
return NULL_TREE; return NULL_TREE;
} }
...@@ -4721,7 +4719,7 @@ handle_tls_model_attribute (tree *node, tree name, tree args, ...@@ -4721,7 +4719,7 @@ handle_tls_model_attribute (tree *node, tree name, tree args,
if (!DECL_THREAD_LOCAL (decl)) if (!DECL_THREAD_LOCAL (decl))
{ {
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); warning ("%qE attribute ignored", name);
*no_add_attrs = true; *no_add_attrs = true;
} }
else else
...@@ -4788,7 +4786,7 @@ handle_malloc_attribute (tree *node, tree name, tree ARG_UNUSED (args), ...@@ -4788,7 +4786,7 @@ handle_malloc_attribute (tree *node, tree name, tree ARG_UNUSED (args),
/* ??? TODO: Support types. */ /* ??? TODO: Support types. */
else else
{ {
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); warning ("%qE attribute ignored", name);
*no_add_attrs = true; *no_add_attrs = true;
} }
...@@ -4806,7 +4804,7 @@ handle_returns_twice_attribute (tree *node, tree name, tree ARG_UNUSED (args), ...@@ -4806,7 +4804,7 @@ handle_returns_twice_attribute (tree *node, tree name, tree ARG_UNUSED (args),
DECL_IS_RETURNS_TWICE (*node) = 1; DECL_IS_RETURNS_TWICE (*node) = 1;
else else
{ {
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); warning ("%qE attribute ignored", name);
*no_add_attrs = true; *no_add_attrs = true;
} }
...@@ -4852,7 +4850,7 @@ handle_pure_attribute (tree *node, tree name, tree ARG_UNUSED (args), ...@@ -4852,7 +4850,7 @@ handle_pure_attribute (tree *node, tree name, tree ARG_UNUSED (args),
/* ??? TODO: Support types. */ /* ??? TODO: Support types. */
else else
{ {
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); warning ("%qE attribute ignored", name);
*no_add_attrs = true; *no_add_attrs = true;
} }
...@@ -4882,7 +4880,7 @@ handle_deprecated_attribute (tree *node, tree name, ...@@ -4882,7 +4880,7 @@ handle_deprecated_attribute (tree *node, tree name,
{ {
tree type = NULL_TREE; tree type = NULL_TREE;
int warn = 0; int warn = 0;
const char *what = NULL; tree what = NULL_TREE;
if (DECL_P (*node)) if (DECL_P (*node))
{ {
...@@ -4914,17 +4912,15 @@ handle_deprecated_attribute (tree *node, tree name, ...@@ -4914,17 +4912,15 @@ handle_deprecated_attribute (tree *node, tree name,
if (type && TYPE_NAME (type)) if (type && TYPE_NAME (type))
{ {
if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE) if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE)
what = IDENTIFIER_POINTER (TYPE_NAME (*node)); what = TYPE_NAME (*node);
else if (TREE_CODE (TYPE_NAME (type)) == TYPE_DECL else if (TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
&& DECL_NAME (TYPE_NAME (type))) && DECL_NAME (TYPE_NAME (type)))
what = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))); what = DECL_NAME (TYPE_NAME (type));
} }
if (what) if (what)
warning ("%qs attribute ignored for %qs", warning ("%qE attribute ignored for %qE", name, what);
IDENTIFIER_POINTER (name), what);
else else
warning ("%qs attribute ignored", warning ("%qE attribute ignored", name);
IDENTIFIER_POINTER (name));
} }
return NULL_TREE; return NULL_TREE;
...@@ -4952,7 +4948,7 @@ handle_vector_size_attribute (tree *node, tree name, tree args, ...@@ -4952,7 +4948,7 @@ handle_vector_size_attribute (tree *node, tree name, tree args,
if (!host_integerp (size, 1)) if (!host_integerp (size, 1))
{ {
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); warning ("%qE attribute ignored", name);
return NULL_TREE; return NULL_TREE;
} }
...@@ -4981,8 +4977,7 @@ handle_vector_size_attribute (tree *node, tree name, tree args, ...@@ -4981,8 +4977,7 @@ handle_vector_size_attribute (tree *node, tree name, tree args,
&& GET_MODE_CLASS (orig_mode) != MODE_INT) && GET_MODE_CLASS (orig_mode) != MODE_INT)
|| !host_integerp (TYPE_SIZE_UNIT (type), 1)) || !host_integerp (TYPE_SIZE_UNIT (type), 1))
{ {
error ("invalid vector type for attribute %qs", error ("invalid vector type for attribute %qE", name);
IDENTIFIER_POINTER (name));
return NULL_TREE; return NULL_TREE;
} }
...@@ -5231,7 +5226,7 @@ handle_nothrow_attribute (tree *node, tree name, tree ARG_UNUSED (args), ...@@ -5231,7 +5226,7 @@ handle_nothrow_attribute (tree *node, tree name, tree ARG_UNUSED (args),
/* ??? TODO: Support types. */ /* ??? TODO: Support types. */
else else
{ {
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); warning ("%qE attribute ignored", name);
*no_add_attrs = true; *no_add_attrs = true;
} }
...@@ -5254,7 +5249,7 @@ handle_cleanup_attribute (tree *node, tree name, tree args, ...@@ -5254,7 +5249,7 @@ handle_cleanup_attribute (tree *node, tree name, tree args,
we'd be missing too much, since we do have attribute constructor. */ we'd be missing too much, since we do have attribute constructor. */
if (TREE_CODE (decl) != VAR_DECL || TREE_STATIC (decl)) if (TREE_CODE (decl) != VAR_DECL || TREE_STATIC (decl))
{ {
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); warning ("%qE attribute ignored", name);
*no_add_attrs = true; *no_add_attrs = true;
return NULL_TREE; return NULL_TREE;
} }
...@@ -5293,7 +5288,7 @@ handle_warn_unused_result_attribute (tree *node, tree name, ...@@ -5293,7 +5288,7 @@ handle_warn_unused_result_attribute (tree *node, tree name,
/* Ignore the attribute for functions not returning any value. */ /* Ignore the attribute for functions not returning any value. */
if (VOID_TYPE_P (TREE_TYPE (*node))) if (VOID_TYPE_P (TREE_TYPE (*node)))
{ {
warning ("%qs attribute ignored", IDENTIFIER_POINTER (name)); warning ("%qE attribute ignored", name);
*no_add_attrs = true; *no_add_attrs = true;
} }
...@@ -5310,8 +5305,7 @@ handle_sentinel_attribute (tree *node, tree name, tree args, ...@@ -5310,8 +5305,7 @@ handle_sentinel_attribute (tree *node, tree name, tree args,
if (!params) if (!params)
{ {
warning ("%qs attribute requires prototypes with named arguments", warning ("%qE attribute requires prototypes with named arguments", name);
IDENTIFIER_POINTER (name));
*no_add_attrs = true; *no_add_attrs = true;
} }
else else
...@@ -5321,8 +5315,7 @@ handle_sentinel_attribute (tree *node, tree name, tree args, ...@@ -5321,8 +5315,7 @@ handle_sentinel_attribute (tree *node, tree name, tree args,
if (VOID_TYPE_P (TREE_VALUE (params))) if (VOID_TYPE_P (TREE_VALUE (params)))
{ {
warning ("%qs attribute only applies to variadic functions", warning ("%qE attribute only applies to variadic functions", name);
IDENTIFIER_POINTER (name));
*no_add_attrs = true; *no_add_attrs = true;
} }
} }
...@@ -5567,8 +5560,8 @@ c_parse_error (const char *msgid, enum cpp_ttype token, tree value) ...@@ -5567,8 +5560,8 @@ c_parse_error (const char *msgid, enum cpp_ttype token, tree value)
message = catenate_messages (msgid, " before numeric constant"); message = catenate_messages (msgid, " before numeric constant");
else if (token == CPP_NAME) else if (token == CPP_NAME)
{ {
message = catenate_messages (msgid, " before %qs"); message = catenate_messages (msgid, " before %qE");
error (message, IDENTIFIER_POINTER (value)); error (message, value);
free (message); free (message);
message = NULL; message = NULL;
} }
...@@ -5712,7 +5705,7 @@ fold_offsetof_1 (tree expr) ...@@ -5712,7 +5705,7 @@ fold_offsetof_1 (tree expr)
if (DECL_C_BIT_FIELD (t)) if (DECL_C_BIT_FIELD (t))
{ {
error ("attempt to take address of bit-field structure " error ("attempt to take address of bit-field structure "
"member %qs", IDENTIFIER_POINTER (DECL_NAME (t))); "member %qD", t);
return error_mark_node; return error_mark_node;
} }
off = size_binop (PLUS_EXPR, DECL_FIELD_OFFSET (t), off = size_binop (PLUS_EXPR, DECL_FIELD_OFFSET (t),
......
...@@ -2370,8 +2370,7 @@ lookup_label (tree name) ...@@ -2370,8 +2370,7 @@ lookup_label (tree name)
if (current_function_decl == 0) if (current_function_decl == 0)
{ {
error ("label %qs referenced outside of any function", error ("label %qE referenced outside of any function", name);
IDENTIFIER_POINTER (name));
return 0; return 0;
} }
...@@ -2413,7 +2412,7 @@ declare_label (tree name) ...@@ -2413,7 +2412,7 @@ declare_label (tree name)
at this scope */ at this scope */
if (b && B_IN_CURRENT_SCOPE (b)) if (b && B_IN_CURRENT_SCOPE (b))
{ {
error ("duplicate label declaration %qs", IDENTIFIER_POINTER (name)); error ("duplicate label declaration %qE", name);
locate_old_decl (b->decl, error); locate_old_decl (b->decl, error);
/* Just use the previous declaration. */ /* Just use the previous declaration. */
...@@ -2471,8 +2470,7 @@ define_label (location_t location, tree name) ...@@ -2471,8 +2470,7 @@ define_label (location_t location, tree name)
if (warn_traditional && !in_system_header && lookup_name (name)) if (warn_traditional && !in_system_header && lookup_name (name))
warning ("%Htraditional C lacks a separate namespace for labels, " warning ("%Htraditional C lacks a separate namespace for labels, "
"identifier %qs conflicts", &location, "identifier %qE conflicts", &location, name);
IDENTIFIER_POINTER (name));
/* Mark label as having been defined. */ /* Mark label as having been defined. */
DECL_INITIAL (label) = error_mark_node; DECL_INITIAL (label) = error_mark_node;
...@@ -2536,9 +2534,8 @@ void ...@@ -2536,9 +2534,8 @@ void
pending_xref_error (void) pending_xref_error (void)
{ {
if (pending_invalid_xref != 0) if (pending_invalid_xref != 0)
error ("%H%qs defined as wrong kind of tag", error ("%H%qE defined as wrong kind of tag",
&pending_invalid_xref_location, &pending_invalid_xref_location, pending_invalid_xref);
IDENTIFIER_POINTER (pending_invalid_xref));
pending_invalid_xref = 0; pending_invalid_xref = 0;
} }
...@@ -5008,18 +5005,16 @@ start_struct (enum tree_code code, tree name) ...@@ -5008,18 +5005,16 @@ start_struct (enum tree_code code, tree name)
if (TYPE_SIZE (ref)) if (TYPE_SIZE (ref))
{ {
if (code == UNION_TYPE) if (code == UNION_TYPE)
error ("redefinition of %<union %s%>", IDENTIFIER_POINTER (name)); error ("redefinition of %<union %E%>", name);
else else
error ("redefinition of %<struct %s%>", IDENTIFIER_POINTER (name)); error ("redefinition of %<struct %E%>", name);
} }
else if (C_TYPE_BEING_DEFINED (ref)) else if (C_TYPE_BEING_DEFINED (ref))
{ {
if (code == UNION_TYPE) if (code == UNION_TYPE)
error ("nested redefinition of %<union %s%>", error ("nested redefinition of %<union %E%>", name);
IDENTIFIER_POINTER (name));
else else
error ("nested redefinition of %<struct %s%>", error ("nested redefinition of %<struct %E%>", name);
IDENTIFIER_POINTER (name));
} }
} }
else else
...@@ -5454,14 +5449,14 @@ start_enum (tree name) ...@@ -5454,14 +5449,14 @@ start_enum (tree name)
} }
if (C_TYPE_BEING_DEFINED (enumtype)) if (C_TYPE_BEING_DEFINED (enumtype))
error ("nested redefinition of %<enum %s%>", IDENTIFIER_POINTER (name)); error ("nested redefinition of %<enum %E%>", name);
C_TYPE_BEING_DEFINED (enumtype) = 1; C_TYPE_BEING_DEFINED (enumtype) = 1;
if (TYPE_VALUES (enumtype) != 0) if (TYPE_VALUES (enumtype) != 0)
{ {
/* This enum is a named one that has been declared already. */ /* This enum is a named one that has been declared already. */
error ("redeclaration of %<enum %s%>", IDENTIFIER_POINTER (name)); error ("redeclaration of %<enum %E%>", name);
/* Completely replace its old definition. /* Completely replace its old definition.
The old enumerators remain defined, however. */ The old enumerators remain defined, however. */
...@@ -6799,7 +6794,7 @@ declspecs_add_qual (struct c_declspecs *specs, tree qual) ...@@ -6799,7 +6794,7 @@ declspecs_add_qual (struct c_declspecs *specs, tree qual)
gcc_unreachable (); gcc_unreachable ();
} }
if (dupe && pedantic && !flag_isoc99) if (dupe && pedantic && !flag_isoc99)
pedwarn ("duplicate %qs", IDENTIFIER_POINTER (qual)); pedwarn ("duplicate %qE", qual);
return specs; return specs;
} }
...@@ -6950,7 +6945,7 @@ declspecs_add_type (struct c_declspecs *specs, struct c_typespec spec) ...@@ -6950,7 +6945,7 @@ declspecs_add_type (struct c_declspecs *specs, struct c_typespec spec)
} }
if (dupe) if (dupe)
error ("duplicate %qs", IDENTIFIER_POINTER (type)); error ("duplicate %qE", type);
return specs; return specs;
} }
...@@ -7079,8 +7074,7 @@ declspecs_add_type (struct c_declspecs *specs, struct c_typespec spec) ...@@ -7079,8 +7074,7 @@ declspecs_add_type (struct c_declspecs *specs, struct c_typespec spec)
{ {
tree t = lookup_name (type); tree t = lookup_name (type);
if (!t || TREE_CODE (t) != TYPE_DECL) if (!t || TREE_CODE (t) != TYPE_DECL)
error ("%qs fails to be a typedef or built in type", error ("%qE fails to be a typedef or built in type", type);
IDENTIFIER_POINTER (type));
else if (TREE_TYPE (t) == error_mark_node) else if (TREE_TYPE (t) == error_mark_node)
; ;
else else
...@@ -7112,8 +7106,7 @@ declspecs_add_scspec (struct c_declspecs *specs, tree scspec) ...@@ -7112,8 +7106,7 @@ declspecs_add_scspec (struct c_declspecs *specs, tree scspec)
&& C_IS_RESERVED_WORD (scspec)); && C_IS_RESERVED_WORD (scspec));
i = C_RID_CODE (scspec); i = C_RID_CODE (scspec);
if (extra_warnings && specs->non_sc_seen_p) if (extra_warnings && specs->non_sc_seen_p)
warning ("%qs is not at beginning of declaration", warning ("%qE is not at beginning of declaration", scspec);
IDENTIFIER_POINTER (scspec));
switch (i) switch (i)
{ {
case RID_INLINE: case RID_INLINE:
...@@ -7162,7 +7155,7 @@ declspecs_add_scspec (struct c_declspecs *specs, tree scspec) ...@@ -7162,7 +7155,7 @@ declspecs_add_scspec (struct c_declspecs *specs, tree scspec)
if (n != csc_none && n == specs->storage_class) if (n != csc_none && n == specs->storage_class)
dupe = true; dupe = true;
if (dupe) if (dupe)
error ("duplicate %qs", IDENTIFIER_POINTER (scspec)); error ("duplicate %qE", scspec);
if (n != csc_none) if (n != csc_none)
{ {
if (specs->storage_class != csc_none && n != specs->storage_class) if (specs->storage_class != csc_none && n != specs->storage_class)
...@@ -7174,8 +7167,7 @@ declspecs_add_scspec (struct c_declspecs *specs, tree scspec) ...@@ -7174,8 +7167,7 @@ declspecs_add_scspec (struct c_declspecs *specs, tree scspec)
specs->storage_class = n; specs->storage_class = n;
if (n != csc_extern && n != csc_static && specs->thread_p) if (n != csc_extern && n != csc_static && specs->thread_p)
{ {
error ("%<__thread%> used with %qs", error ("%<__thread%> used with %qE", scspec);
IDENTIFIER_POINTER (scspec));
specs->thread_p = false; specs->thread_p = false;
} }
} }
......
...@@ -199,7 +199,8 @@ decode_format_attr (tree args, function_format_info *info, int validated_p) ...@@ -199,7 +199,8 @@ decode_format_attr (tree args, function_format_info *info, int validated_p)
if (info->format_type == format_type_error) if (info->format_type == format_type_error)
{ {
gcc_assert (!validated_p); gcc_assert (!validated_p);
warning ("%qs is an unrecognized format function type", p); warning ("%qE is an unrecognized format function type",
format_type_id);
return false; return false;
} }
} }
......
...@@ -136,8 +136,7 @@ c_incomplete_type_error (tree value, tree type) ...@@ -136,8 +136,7 @@ c_incomplete_type_error (tree value, tree type)
if (value != 0 && (TREE_CODE (value) == VAR_DECL if (value != 0 && (TREE_CODE (value) == VAR_DECL
|| TREE_CODE (value) == PARM_DECL)) || TREE_CODE (value) == PARM_DECL))
error ("%qs has an incomplete type", error ("%qD has an incomplete type", value);
IDENTIFIER_POINTER (DECL_NAME (value)));
else else
{ {
retry: retry:
...@@ -180,12 +179,11 @@ c_incomplete_type_error (tree value, tree type) ...@@ -180,12 +179,11 @@ c_incomplete_type_error (tree value, tree type)
} }
if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE) if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE)
error ("invalid use of undefined type %<%s %s%>", error ("invalid use of undefined type %<%s %E%>",
type_code_string, IDENTIFIER_POINTER (TYPE_NAME (type))); type_code_string, TYPE_NAME (type));
else else
/* If this type has a typedef-name, the TYPE_NAME is a TYPE_DECL. */ /* If this type has a typedef-name, the TYPE_NAME is a TYPE_DECL. */
error ("invalid use of incomplete typedef %qs", error ("invalid use of incomplete typedef %qD", TYPE_NAME (type));
IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))));
} }
} }
...@@ -1556,8 +1554,7 @@ build_component_ref (tree datum, tree component) ...@@ -1556,8 +1554,7 @@ build_component_ref (tree datum, tree component)
if (!field) if (!field)
{ {
error ("%qT has no member named %qs", type, error ("%qT has no member named %qE", type, component);
IDENTIFIER_POINTER (component));
return error_mark_node; return error_mark_node;
} }
...@@ -1592,8 +1589,8 @@ build_component_ref (tree datum, tree component) ...@@ -1592,8 +1589,8 @@ build_component_ref (tree datum, tree component)
return ref; return ref;
} }
else if (code != ERROR_MARK) else if (code != ERROR_MARK)
error ("request for member %qs in something not a structure or union", error ("request for member %qE in something not a structure or union",
IDENTIFIER_POINTER (component)); component);
return error_mark_node; return error_mark_node;
} }
...@@ -2811,16 +2808,16 @@ readonly_error (tree arg, enum lvalue_use use) ...@@ -2811,16 +2808,16 @@ readonly_error (tree arg, enum lvalue_use use)
if (TYPE_READONLY (TREE_TYPE (TREE_OPERAND (arg, 0)))) if (TYPE_READONLY (TREE_TYPE (TREE_OPERAND (arg, 0))))
readonly_error (TREE_OPERAND (arg, 0), use); readonly_error (TREE_OPERAND (arg, 0), use);
else else
error (READONLY_MSG (N_("assignment of read-only member %qs"), error (READONLY_MSG (N_("assignment of read-only member %qD"),
N_("increment of read-only member %qs"), N_("increment of read-only member %qD"),
N_("decrement of read-only member %qs")), N_("decrement of read-only member %qD")),
IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (arg, 1)))); TREE_OPERAND (arg, 1));
} }
else if (TREE_CODE (arg) == VAR_DECL) else if (TREE_CODE (arg) == VAR_DECL)
error (READONLY_MSG (N_("assignment of read-only variable %qs"), error (READONLY_MSG (N_("assignment of read-only variable %qD"),
N_("increment of read-only variable %qs"), N_("increment of read-only variable %qD"),
N_("decrement of read-only variable %qs")), N_("decrement of read-only variable %qD")),
IDENTIFIER_POINTER (DECL_NAME (arg))); arg);
else else
error (READONLY_MSG (N_("assignment of read-only location"), error (READONLY_MSG (N_("assignment of read-only location"),
N_("increment of read-only location"), N_("increment of read-only location"),
...@@ -5293,8 +5290,7 @@ set_init_label (tree fieldname) ...@@ -5293,8 +5290,7 @@ set_init_label (tree fieldname)
} }
if (tail == 0) if (tail == 0)
error ("unknown field %qs specified in initializer", error ("unknown field %qE specified in initializer", fieldname);
IDENTIFIER_POINTER (fieldname));
else else
{ {
constructor_fields = tail; constructor_fields = tail;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment