var args
Henry Spencer
henry at utzoo.UUCP
Sun Oct 16 14:15:33 AEST 1983
How do you implement variable numbers of arguments in C? In a word,
unportably. (Is that a word?) The implementation is fundamentally
machine-dependent. There are portable "library" facilities for doing
it in some Unixes, but the insides of those libraries are still quite
machine-dependent. Scanning a variable-length argument list requires
knowing the C calling sequence on the machine in question, so that you
know how the arguments are laid out in core. Machines differ enough
on this point that machine-independent code for it is impossible.
--
Henry Spencer @ U of Toronto Zoology
{allegra,ihnp4,linus,decvax}!utzoo!henry
More information about the Comp.lang.c
mailing list