varargs

blarson at usc-oberon.UUCP blarson at usc-oberon.UUCP
Mon Apr 21 14:13:36 AEST 1986


I just wrote the varargs.h header file for os9/68000 from the 4.2 BSD
documentation, (rather than hacking up the non-portable code in
microemacs) and would like a few clarifacations:

Must va_alist be the only thing in the argument list?  (If this is not
true, I don't see how to implement varargs with this compiler.)  (The
example in the documentation seems to back up my assumption.)

Is it leagal to pass a the rest of an argument list to another
function expecting it?  If so, should it be passed as a pointer to a
variable of type va_list?  (Without this capability, I supose I'll
have to document this as a non-portable use of varargs.)

I assume va_start be done in the original function.  (Dito the first
va_alist comment.)  Does va_end have to be done in the original
function also?  (va_end does nothing in my implementation.)

Thanks.  I do plan on making this available to other os9/68000 users,
preferably by talking microware into distributing it with the next
release of thier C compiler.

-- 
Bob Larson
Arpa: Blarson at Usc-Ecl.Arpa
Uucp: ihnp4!sdcrdcf!usc-oberon!blarson



More information about the Comp.lang.c mailing list