Variable argument lists.

Doug Gwyn gwyn at brl-smoke.ARPA
Mon May 16 04:48:02 AEST 1988


In article <1740 at rpp386.UUCP> jfh at rpp386.UUCP (The Beach Bum) writes:
>the addition of an extra instruction to stack the number of arguments
>can hardly be considered significantly slowing down a function call.

WRONG.  Multiply the extra cost per function call by the number of
function calls per day, to see how much computer time you would be
wasting each day.

Function call overhead is so significant that, for example, when
Gould figured out a way to save a small amount for UTX-32 Release
1.3 (I think it was), they made the change even though it introduced
an incompatibility with existing UTX-32 object code.

>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.

But it is NOT a very useful function.  There are already ways to
obtain corresponding functionality when necessary (which is almost
never), without forcing EVERY function call to pay the penalty.

The main reason ANSI C has a different syntax for variadic-argument
functions is precisely to avoid forcing a less efficient function
linkage overhead for the VAST MAJORITY of function calls.  Those
that need the service should pay the price.  Down with socialism.



More information about the Comp.lang.c mailing list