Path: utzoo!attcan!uunet!lll-winken!ames!mailrus!husc6!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: passing variable numbers of arguments Message-ID: <9308@smoke.BRL.MIL> Date: 7 Jan 89 10:16:02 GMT References: <899@thor.stolaf.edu> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 15 In article <899@thor.stolaf.edu> edf@rocky2.rockefeller.edu writes: >The following program produces unexpected results: >foo (va_alist) > va_dcl >{ > bar (va_alist); >} No wonder! The only proper way to pass a variable argument list down another level is to pass an initialized va_list object. The bar() function cannot be called both with variable arguments AND with a single va_list argument. Check out the specs for vfprintf() and friends to see how this approach works.