Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!eecae!tank!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.unix.wizards Subject: Re: Calling Varargs Twice on a Sun 3 (MC68020) Message-ID: <16490@mimsy.UUCP> Date: 22 Mar 89 10:50:48 GMT References: <1698@spp2.UUCP> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 51 In article <1698@spp2.UUCP> simpson@trwarcadia.uucp writes: >Can anyone tell me the magic incantation to call varargs twice on a Sun 3/60? There is no such incantation; what you are trying to do is, in general, impossible. >b(va_alist) >va_dcl >{ ... >} > >/* a() calls b() */ >a(va_alist) >va_dcl >{ ... > b(va_alist); What you need to do instead (which is not only possible, but even portable) is this: b(va_alist) va_dcl { va_list ap; va_start(ap); vb(ap); va_end(ap); } vb(ap) va_list ap; { ... } a(va_alist) va_dcl { va_lits ap; va_start(ap); vb(ap); ... This is why v*printf() exist. -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris