Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!gatech!uflorida!haven!ncifcrf!nlm-mcs!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Variarg Neophyte Question Message-ID: <10714@smoke.BRL.MIL> Date: 12 Aug 89 06:52:38 GMT References: <2658@cbnewsm.ATT.COM> Reply-To: gwyn@brl.arpa (Doug Gwyn) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 16 In article <2658@cbnewsm.ATT.COM> rgr@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, not which was a precursor that served as a rough guide when X3J11 designed the specification for . 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 .