[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
variable arguments to functions
- To: tech_(_at_)_openbsd_(_dot_)_org
- Subject: variable arguments to functions
- From: Matt Patton <mep_(_at_)_netsec_(_dot_)_net>
- Date: Wed, 17 Nov 1999 16:16:31 -0500 (EST)
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?
Visit your host, monkey.org