Variable argument lists.

John F. Haugh II jfh at rpp386.UUCP
Sat May 14 15:31:29 AEST 1988


In article <7864 at alice.UUCP> ark at alice.UUCP writes:
>In article <14139 at brl-adm.ARPA>, bates%falcon.dnet%fermat at bru.mayo.edu writes:
> 
>>        Does anybody know (or care) why in ANSI standard C when 
>>        using a variable length argument list, there is no way to 
>>        determine how many arguments where passed into the function?
>
>Such a facility is hard to implement in some
>machine architectures without significantly slowing down
>every function call, even those that don't use it.

the addition of an extra instruction to stack the number of arguments
can hardly be considered significantly slowing down a function call.
this sounds like the anti-recursion argument IBM is so fond of - `but
stacking all those variables is SO expensive' ...

the addition of one more instruction (or two or three or whatever for
really deficient hardware) to provide such a useful function would
seem like A Good Thing.

- john.
-- 
John F. Haugh II                 | "You see, I want a lot. Perhaps I want every
River Parishes Programming       | -thing.  The darkness that comes with every
UUCP:   ihnp4!killer!rpp386!jfh  | infinite fall and the shivering blaze of
DOMAIN: jfh at rpp386               | every step up ..." -- Rainer Maria Rilke



More information about the Comp.lang.c mailing list