🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #2024

Re: stdarg: va_list pass by value?

#2024
From: Doug Gwyn
Date: Sat, 01 Dec 1990 00:19
11 lines
1061 bytes
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.
Technical Details
Message-ID: <14627@smoke.brl.mil>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!uflorida!haven!adm!smoke!gwyn
References: <136152@pyramid.pyramid.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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