Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!cmcl2!seismo!umcp-cs!chris From: chris@umcp-cs.UUCP (Chris Torek) Newsgroups: net.unix,net.unix-wizards Subject: Re: Need help on VARARGS and RCS Message-ID: <993@umcp-cs.UUCP> Date: Thu, 17-Apr-86 14:54:40 EST Article-I.D.: umcp-cs.993 Posted: Thu Apr 17 14:54:40 1986 Date-Received: Sat, 19-Apr-86 14:17:25 EST References: <198@butler.UUCP> Reply-To: chris@maryland.UUCP (Chris Torek) Organization: University of Maryland, Dept. of Computer Sci. Lines: 41 Xref: watmath net.unix:7661 net.unix-wizards:17678 In article <198@butler.UUCP> chinn@butler.UUCP (David Chinn) writes: >We have a copy of RCS [which] core dumps when you do a 'ci f.c'. >[...] the coredump occurs during a routine called "diagnose", >[which] looks like: > >diagnose(va_alist) >va_dcl >{ > if (!quietflag) { > fprintf(stderr,va_alist); > putc('\n',stderr); > } >} > >The question is, how is this supposed to work? I found a mention >of 'va_alist' under varargs, but the usage example grabs the >arguments in the called routine. Passing the list to fprintf (or printf) is incorrect usage. In System V, there is a `vfprintf', which does indeed take a variable argument list. >We are running ULTRIX 1.0 on a VAX-11/750. On a Vax running 4.2BSD-equivalent code (Ultrix) the following version of `diagnose' will work. Please note that this is *not* portable. diagnose(fmt, arg) char *fmt; { if (!quietflag) { _doprnt(fmt, &arg, stderr); /* magic */ (void) putc('\n', stderr); } } -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 1415) UUCP: seismo!umcp-cs!chris CSNet: chris@umcp-cs ARPA: chris@mimsy.umd.edu