At 12:07 AM 10/13/00 +0100, Simon Cozens wrote:
>On Thu, Oct 12, 2000 at 03:24:23PM -0700, Russ Allbery wrote:
> > Can't. ISO C requires that all variadic functions take at least one named
> > parameter. The best you can do is something like (void *, ...).
Well, damn. And I mean that sincerely. :(
>Argh. Can't we just use a stack? I like stacks. Stacks make sense.
Stacks cost time and programmer effort. Parameters are generally passed in
registers, (how many depends on your architecture, but sane ones have a
bunch) while stacks require smacking data into memory somewhere and messing
with the stack pointer. Even if you have a macro to push, it means doing this:
PUSH(i);
PUSH(j);
PUSH(k);
call_foo();
instead of:
call_foo(i, j, k);
Stacks are OK for internal work (though I'd prefer a register file, if even
a virtual one) but for externally exposed stuff we're better off taking
parameters if we can.
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk