Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!gorodish!guy From: guy@gorodish.Sun.COM (Guy Harris) Newsgroups: comp.lang.c Subject: Re: problems with varargs Message-ID: <39767@sun.uucp> Date: 22 Jan 88 23:35:45 GMT References: <7962@eleazar.Dartmouth.EDU> <6394@oberon.USC.EDU> Sender: news@sun.uucp Lines: 17 Keywords: varargs > va_alist MUST be the only argument to a varargs function. (Lint (sun > 3.2) gets this horrably WRONG. If you don't get a ton of error > messages from lint you made a mistake. Gee, I guess AT&T made a mistake, too, because that code linted quite happily on a 3B2 running S5R3.1. 4.2BSD has nothing to do with it.... Fortunately, ANSI C repairs this deficiency; va_alist need not be the only argument to a "stdargs" function. "va_start" takes an extra argument, which is the last non-varargs parameter to the function; presumably, this is intended to permit this to work on machines where "varargs" won't work if "va_alist" isn't the only argument to the function (I presume they exist, although none of the machines I've worked with, including my trusty Sun-4, have a problem with this). Guy Harris {ihnp4, decvax, seismo, decwrl, ...}!sun!guy guy@sun.com