OSDN Git Service

* c-common.c, c-decl.c, c-format.c, c-typeck.c: Use %D for
[pf3gnuchains/gcc-fork.git] / gcc / c-typeck.c
index 9c94b03..6f2a6bc 100644 (file)
@@ -136,8 +136,7 @@ c_incomplete_type_error (tree value, tree type)
 
   if (value != 0 && (TREE_CODE (value) == VAR_DECL
                     || TREE_CODE (value) == PARM_DECL))
-    error ("%qs has an incomplete type",
-          IDENTIFIER_POINTER (DECL_NAME (value)));
+    error ("%qD has an incomplete type", value);
   else
     {
     retry:
@@ -180,12 +179,11 @@ c_incomplete_type_error (tree value, tree type)
        }
 
       if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE)
-       error ("invalid use of undefined type %<%s %s%>",
-              type_code_string, IDENTIFIER_POINTER (TYPE_NAME (type)));
+       error ("invalid use of undefined type %<%s %E%>",
+              type_code_string, TYPE_NAME (type));
       else
        /* If this type has a typedef-name, the TYPE_NAME is a TYPE_DECL.  */
-       error ("invalid use of incomplete typedef %qs",
-              IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))));
+       error ("invalid use of incomplete typedef %qD", TYPE_NAME (type));
     }
 }
 
@@ -1556,8 +1554,7 @@ build_component_ref (tree datum, tree component)
 
       if (!field)
        {
-         error ("%qT has no member named %qs", type,
-                IDENTIFIER_POINTER (component));
+         error ("%qT has no member named %qE", type, component);
          return error_mark_node;
        }
 
@@ -1592,8 +1589,8 @@ build_component_ref (tree datum, tree component)
       return ref;
     }
   else if (code != ERROR_MARK)
-    error ("request for member %qs in something not a structure or union",
-           IDENTIFIER_POINTER (component));
+    error ("request for member %qE in something not a structure or union",
+          component);
 
   return error_mark_node;
 }
@@ -2811,16 +2808,16 @@ readonly_error (tree arg, enum lvalue_use use)
       if (TYPE_READONLY (TREE_TYPE (TREE_OPERAND (arg, 0))))
        readonly_error (TREE_OPERAND (arg, 0), use);
       else
-       error (READONLY_MSG (N_("assignment of read-only member %qs"),
-                            N_("increment of read-only member %qs"),
-                            N_("decrement of read-only member %qs")),
-              IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (arg, 1))));
+       error (READONLY_MSG (N_("assignment of read-only member %qD"),
+                            N_("increment of read-only member %qD"),
+                            N_("decrement of read-only member %qD")),
+              TREE_OPERAND (arg, 1));
     }
   else if (TREE_CODE (arg) == VAR_DECL)
-    error (READONLY_MSG (N_("assignment of read-only variable %qs"),
-                        N_("increment of read-only variable %qs"),
-                        N_("decrement of read-only variable %qs")),
-          IDENTIFIER_POINTER (DECL_NAME (arg)));
+    error (READONLY_MSG (N_("assignment of read-only variable %qD"),
+                        N_("increment of read-only variable %qD"),
+                        N_("decrement of read-only variable %qD")),
+          arg);
   else
     error (READONLY_MSG (N_("assignment of read-only location"),
                         N_("increment of read-only location"),
@@ -5293,8 +5290,7 @@ set_init_label (tree fieldname)
     }
 
   if (tail == 0)
-    error ("unknown field %qs specified in initializer",
-          IDENTIFIER_POINTER (fieldname));
+    error ("unknown field %qE specified in initializer", fieldname);
   else
     {
       constructor_fields = tail;