stdarg: va_list pass by value?

Doug Gwyn gwyn at smoke.brl.mil
Sat Dec 1 11:19:34 AEST 1990


In article <136152 at pyramid.pyramid.com> markhall at 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.



More information about the Comp.std.c mailing list