+1999-11-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * decl.c (pushdecl, grokdeclarator): Don't call a variadic
+ function with a non-literal format string.
+
+ * lex.c (do_identifier): Likewise.
+
+ * typeck.c (build_unary_op): Likewise.
+
1999-11-23 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (DECL_NEEDED_P): Tweak to match documentation.
/* No shadow warnings for vars made for inlining. */
&& ! DECL_FROM_INLINE (x))
{
- const char *warnstring = NULL;
-
if (oldlocal != NULL_TREE && TREE_CODE (oldlocal) == PARM_DECL)
- warnstring = "declaration of `%s' shadows a parameter";
+ warning ("declaration of `%s' shadows a parameter",
+ IDENTIFIER_POINTER (name));
else if (IDENTIFIER_CLASS_VALUE (name) != NULL_TREE
&& current_class_ptr
&& !TREE_STATIC (name))
- warnstring = "declaration of `%s' shadows a member of `this'";
+ warning ("declaration of `%s' shadows a member of `this'",
+ IDENTIFIER_POINTER (name));
else if (oldlocal != NULL_TREE)
- warnstring = "declaration of `%s' shadows previous local";
+ warning ("declaration of `%s' shadows previous local",
+ IDENTIFIER_POINTER (name));
else if (oldglobal != NULL_TREE)
/* XXX shadow warnings in outer-more namespaces */
- warnstring = "declaration of `%s' shadows global declaration";
-
- if (warnstring)
- warning (warnstring, IDENTIFIER_POINTER (name));
+ warning ("declaration of `%s' shadows global declaration",
+ IDENTIFIER_POINTER (name));
}
}
op ? operator_name_string (tmp) : name);
}
else
- error (((decl_context == PARM || decl_context == CATCHPARM)
- ? "storage class specified for parameter `%s'"
- : "storage class specified for typename"), name);
+ {
+ if (decl_context == PARM || decl_context == CATCHPARM)
+ error ("storage class specified for parameter `%s'", name);
+ else
+ error ("storage class specified for typename");
+ }
RIDBIT_RESET (RID_REGISTER, specbits);
RIDBIT_RESET (RID_AUTO, specbits);
RIDBIT_RESET (RID_EXTERN, specbits);
}
else if (!DECL_ERROR_REPORTED (id))
{
- static char msg[]
- = "name lookup of `%s' changed for new ANSI `for' scoping";
DECL_ERROR_REPORTED (id) = 1;
if (TYPE_NEEDS_DESTRUCTOR (TREE_TYPE (id)))
{
- error (msg, IDENTIFIER_POINTER (token));
+ error ("name lookup of `%s' changed for new ANSI `for' scoping",
+ IDENTIFIER_POINTER (token));
cp_error_at (" cannot use obsolete binding at `%D' because it has a destructor", id);
id = error_mark_node;
}
else
{
- pedwarn (msg, IDENTIFIER_POINTER (token));
+ pedwarn ("name lookup of `%s' changed for new ANSI `for' scoping",
+ IDENTIFIER_POINTER (token));
cp_pedwarn_at (" using obsolete binding at `%D'", id);
}
}