Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: net.lang.c Subject: Re: var args Message-ID: <3258@utzoo.UUCP> Date: Sun, 16-Oct-83 00:15:33 EDT Article-I.D.: utzoo.3258 Posted: Sun Oct 16 00:15:33 1983 Date-Received: Sun, 16-Oct-83 00:15:33 EDT References: <3637@duke.UUCP> Organization: U of Toronto Zoology Lines: 11 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