+2004-10-28 Adam Nemet <anemet@lnxw.com>
+
+ PR middle-end/18160
+ * c-typeck.c (c_mark_addressable): Issue error if address of a
+ register variable is taken. Use "%qD" to print DECL_NAME.
+
2004-10-28 Diego Novillo <dnovillo@redhat.com>
* opts.c (decode_options): Don't run PRE at -Os.
case COMPONENT_REF:
if (DECL_C_BIT_FIELD (TREE_OPERAND (x, 1)))
{
- error ("cannot take address of bit-field %qs",
- IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (x, 1))));
+ error
+ ("cannot take address of bit-field %qD", TREE_OPERAND (x, 1));
return false;
}
{
if (TREE_PUBLIC (x) || TREE_STATIC (x) || DECL_EXTERNAL (x))
{
- error ("global register variable %qs used in nested function",
- IDENTIFIER_POINTER (DECL_NAME (x)));
+ error
+ ("global register variable %qD used in nested function", x);
return false;
}
- pedwarn ("register variable %qs used in nested function",
- IDENTIFIER_POINTER (DECL_NAME (x)));
+ pedwarn ("register variable %qD used in nested function", x);
}
else if (C_DECL_REGISTER (x))
{
if (TREE_PUBLIC (x) || TREE_STATIC (x) || DECL_EXTERNAL (x))
- {
- error ("address of global register variable %qs requested",
- IDENTIFIER_POINTER (DECL_NAME (x)));
- return false;
- }
-
- pedwarn ("address of register variable %qs requested",
- IDENTIFIER_POINTER (DECL_NAME (x)));
+ error ("address of global register variable %qD requested", x);
+ else
+ error ("address of register variable %qD requested", x);
+ return false;
}
/* drops in */