+2004-10-02 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * c-typeck.c (warn_for_assignment): Don't permit argnum == 0.
+
2004-10-01 Ulrich Weigand <uweigand@de.ibm.com>
* config/s390/s390-protos.h (s390_comparison): Add prototype.
/* Print a warning using MSGID.
It gets OPNAME as its one parameter.
- if OPNAME is null and ARGNUM is 0, it is replaced by "passing arg of `FUNCTION'".
- Otherwise if OPNAME is null, it is replaced by "passing arg ARGNUM of `FUNCTION'".
+ If OPNAME is null, it is replaced by "passing arg ARGNUM of 'FUNCTION'".
FUNCTION and ARGNUM are handled specially if we are building an
Objective-C selector. */
function = selector;
argnum -= 2;
}
- if (argnum == 0)
- {
- if (function)
- {
- /* Function name is known; supply it. */
- const char *const argstring = _("passing arg of '%s'");
- new_opname = (char *) alloca (IDENTIFIER_LENGTH (function)
- + strlen (argstring) + 1 + 1);
- sprintf (new_opname, argstring,
- IDENTIFIER_POINTER (function));
- }
- else
- {
- /* Function name unknown (call through ptr). */
- const char *const argnofun = _("passing arg of pointer to function");
- new_opname = (char *) alloca (strlen (argnofun) + 1 + 1);
- sprintf (new_opname, argnofun);
- }
- }
- else if (function)
+ gcc_assert (argnum > 0);
+ if (function)
{
/* Function name is known; supply it. */
const char *const argstring = _("passing arg %d of '%s'");