Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!lll-winken!elroy.jpl.nasa.gov!usc!samsung!think.com!mintaka!bloom-beacon!eru!hagbard!sunic!ugle.unit.no!nuug!ifi!enag From: enag@ifi.uio.no (Erik Naggum) Newsgroups: comp.lang.c Subject: Re: stdarg Message-ID: Date: 6 Feb 91 22:06:58 GMT References: <1991Feb5.145001.26837@hounix.uucp> <588@taumet.com> <1991Feb6.171144.7182@Neon.Stanford.EDU> Sender: enag@ifi.uio.no (Erik Naggum) Organization: Naggum Software, Oslo, Norway Lines: 28 In-Reply-To: dkeisen@Gang-of-Four.Stanford.EDU's message of 6 Feb 91 17:11:44 GMT In article <1991Feb6.171144.7182@Neon.Stanford.EDU>, Dave Eisen writes: > In article <588@taumet.com>, Stephen Clamage writes: >> In article , Paul Elliott writes: >>> In ansi C, is there a way to have a function with a variable argument list >>> and zero fixed parameters? If so what would one use for the second parameter >>> to va_start, which is normally supposed to be the last fixed parameter? > >> Not in ANSI C. The method requires at least one fixed argument. > > Probably a reasonable decision. But it does make it a pain to deal > with the third party software we use that is full of functions > that can take 0 or more arguments. How do these functions determine how many arguments to use, and what type they are? My experience (although limited with "third party software"), is that -based functions only appear to have "0 or more arguments", since the first thing they do is to get the arguments that are of known type, including some "format specifier" or other "argument type and count list". Is this not so? I found ANSI X3J11's decision to make the first argument of known type very wise. In fact, the whole thing is pretty nifty. -- [Erik Naggum] Naggum Software, Oslo, Norway