Contiguous function arguments

Henry Spencer henry at utzoo.UUCP
Sat Feb 23 02:49:07 AEST 1985


> Where is it written that function arguments must appear on the
> stack contiguously?  K & R says the arguments are "passed by value", giving
> no indication that the arguments should be on the stack or in a register.

Nowhere is it written that function arguments must appear on the stack
contiguously, although there are a number of brain-damaged programs
that assume they do.  The main problem that must be coped with, if
another scheme is used, is the implementation of printf() and its kin.
It is useful, although not absolutely vital, if you can devise a way
of implementing the <varargs.h> primitives also.  This is harder, since
printf() and such can always be kludged in some messy way, but <varargs.h>
forces you to provide a clean interface to the mess.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry



More information about the Comp.lang.c mailing list