Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 beta 3/9/83; site cwruecmp.UUCP Path: utzoo!linus!decvax!cwruecmp!decot From: decot@cwruecmp.UUCP (Dave Decot) Newsgroups: net.lang.c Subject: Re: %r, and why it disappeared (a theory) Message-ID: <718@cwruecmp.UUCP> Date: Thu, 20-Oct-83 20:55:48 EDT Article-I.D.: cwruecmp.718 Posted: Thu Oct 20 20:55:48 1983 Date-Received: Sat, 22-Oct-83 02:16:23 EDT References: <333@wjh12.UUCP> Organization: CWRU Computer Engr. Cleveland, Ohio Lines: 21 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