gripe: variable arg lists

Henry Spencer henry at utzoo.UUCP
Tue Nov 20 04:06:06 AEST 1984


> >Unfortunately, the ability to implement <varargs.h> is, to some extent,
> >machine-dependent.  There are some machines where variable argument lists
> >are very hard to do, and must be kludged in very machine-dependent ways.
> 
> As long as they can be kludged.
> That's why the definitions are hidden in an include file. That way, to
> the user, they don't appear machine-dependant.

You miss my point.  I didn't say that the implementation of <varargs.h>
was machine-dependent; that's obvious.  I said that the *ability* to
implement <varargs.h> is machine-dependent.  There are machines on which
that user interface to variable-length argument lists simply cannot be
implemented, period.

> How about another addition to <varargs.h>, which, given a function,
> its return type, and one of the (partially-used) va_list's, passes
> the remaining arguments referred to by the va_list to the function?

I haven't studied this closely, but I suspect that the same comment may
apply:  the ability to do this is machine-dependent.  A partially-used
argument list does not necessarily look like a shorter complete argument
list.

Hey, people, we've been over and over this point here and in unix-wizards:
THERE IS NO FULLY PORTABLE WAY TO DO VARIABLE-LENGTH ARGUMENT LISTS IN C!!!

Rebuttals by mail, please, so I can tell you why your idea won't work
without needing to thrash this out AGAIN in front of everyone.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry



More information about the Comp.lang.c mailing list