[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

variable arguments to functions

1st: why do we have these "ifdef _STDC__" wrappers around procedures that take 
variable arguments? We (OpenbSD) uses the calls that way so 'who' externally
is this code for?

eg. lib/libc/stdio/*printf.c

2nd, if the variable arg is always last in the list, should the the procedure
header end in (foo, ...) or (foo, va_list ap)?

3rd, assuming all procedures in the calling chain put the variable arg on the
end, is there any reason to have to call va_start, va_arg and va_end? Why not
just pass the va_list variable? (if ! _STDC_ do we have to call them anyway?)

4th, why is there no va_start in any of the v*printf.c's in lib/libc/stdio?
does that mean the caller of v*printf will have already invoked va_start?