Path: utzoo!attcan!uunet!lll-winken!ames!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: passing variable numbers of arguments Message-ID: <9321@smoke.BRL.MIL> Date: 10 Jan 89 02:27:28 GMT References: <899@thor.stolaf.edu> <15341@mimsy.UUCP> <449@marob.MASA.COM> <9317@smoke.BRL.MIL> <11378@haddock.ima.isc.com> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Distribution: na Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 13 In article <11378@haddock.ima.isc.com> karl@haddock.ima.isc.com (Karl Heuer) writes: >Yes, it does seem as though nargs() is not very useful for polymorphic >functions. (And, as Doug pointed out, the number-of-words implementation is >bad--though this could be fixed by having nargs() return the number of bytes >so that the application could say nb -= sizeof(TYPE), assuming it knows what >type to expect next.) No, if nargs() has any use at all it cannot be this. The reason that the va_ stuff must be used for portable access to arguments is that many architectures do not have a simple, clean model for argument alignment (which might be different from that indicated by sizeof), and some pass some of the arguments different from others. nbytes() would be of no value in portable programming.