stdarg: safe to pass va_list * and have callees va_arg(*args, type)??

Lawrence Kirby fred@genesis.demon.co.uk
Fri Oct 1 00:00:00 GMT 1999


In article < 87906vtk8h.fsf@pfaffben.user.msu.edu >
           pfaffben@msu.edu "Ben Pfaff" writes:

>fred@genesis.demon.co.uk (Lawrence Kirby) writes:
>
>   In article < 877lmgwz3c.fsf@pfaffben.user.msu.edu >
>              pfaffben@msu.edu "Ben Pfaff" writes:
>
>   >Basically, the Standard says that va_list is an opaque type.
>
>   Nevertheless it is an object type.
>
>You have a point.  I bow to your superior wisdom.

I see that a footnote has been added to C9X clarifying the intent here

"It is permitted to create a pointer to a va_list and pass that pointer
 to another function, in which case the original function may make
 further use of the original list after the other function returns."

I think this can be taken as the intent in the current standard too.

-- 
-----------------------------------------
Lawrence Kirby | fred@genesis.demon.co.uk
Wilts, England | 70734.126@compuserve.com
-----------------------------------------



More information about the Gcc-help mailing list