Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!uflorida!haven!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.std.c Subject: Re: stdarg: va_list pass by value? Message-ID: <14627@smoke.brl.mil> Date: 1 Dec 90 00:19:34 GMT References: <136152@pyramid.pyramid.com> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 11 In article <136152@pyramid.pyramid.com> markhall@pyrps5.pyramid.com (Mark Hall) writes: >Should the va_list object have pass-by-value semantics, or >pass-by-reference (ie, does the "value" of the va_list object change)? This is intentionally not specified. After your string1() function returns, the value of ap in the string1_or_2() function is indeterminate; if you want to continue using it in a strictly-conforming program you must invoke va_end(ap) then another va_start(ap,dummy), which will reset the pointer to the start of the variable argument list. This was thrashed out in committee; please don't argue about it now.