Variarg Neophyte Question

Doug Gwyn gwyn at smoke.BRL.MIL
Sat Aug 12 16:52:38 AEST 1989


In article <2658 at cbnewsm.ATT.COM> rgr at cbnewsm.ATT.COM (Duke Robillard) writes:
>I was just looking at variargs.h for the first time and
>found a little inconsistency.  In K&R 2, it says (page 254)
>that va_start() gets two arguments :
>	va_start(va_list ap, lastarg);
>but on my Sun (running SunOS 4.0) it only wants the first
>argument.  What's up?  Is somebody out of date?  

Geez, where to begin.  First, note that K&R 2nd Ed. explicitly describes
Standard C, not the historical C found implemented on your Sun.  Next,
note that K&R 2 describes the macros defined by including <stdarg.h>,
not <varargs.h> which was a precursor that served as a rough guide when
X3J11 designed the specification for <stdarg.h>.  The Standard C variadic
argument mechanism is considerably different from the old varargs
approach; many compiler vendors will be providing both headers for
reasons of backward compatibility.  Finally, note how to spell <varargs.h>.



More information about the Comp.lang.c mailing list