%r, and why it disappeared (a theory)

Dave Decot decot at cwruecmp.UUCP
Fri Oct 21 10:55:48 AEST 1983


It is not exactly impossible, without the aid of %r, to make something that
reacts in an expected way to a call like

	err("identifier '%s' not declared in function %s", id, fun);

Declare err() as:

/*VARARGS 1*/
err(fmt, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
char *fmt;
int a1, a2, a3, a4, a5, a6, a7, a8, a9, a10;
{
    fprintf(stderr, "%d: ", Linenum);
    fprintf(stderr, fmt, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
    fputs(stderr, "!!!\007\n");
}

This can be extended if you REALLY need more than up to 10 arguments.

----------------------------------------
Dave Decot	..!decvax!cwruecmp!decot



More information about the Comp.lang.c mailing list