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

Richard Heathfield complangc@eton.powernet.co.uk
Fri Oct 1 00:00:00 GMT 1999


Andomar <nothing@like.the.sun> wrote in article
< 37C753EB.7227A1A3@like.the.sun >...
> One question: why are you passing a pointer to the
> va_list?  You can just pass the va_list itself,
> vsnprintf does that for example.
> 
> And since vsnprintf does it, I think it's safe
> and legal use of va_list.
> 

Recommending the usage of vsnprintf is fine in gnu.gcc.help, but not in
comp.lang.c, where this function hasn't yet been accepted into the canon. I
understand this will change in C9X, so perhaps you should re-post your
reply in about 3 years. :-)

(I make no comment as to the accuracy of your advice, because I have no
idea (yet) what vsnprintf does, as from my perspective it doesn't (yet)
exist.)


-- 
Richard Heathfield

"Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.






More information about the Gcc-help mailing list