Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!houxm!vax135!cornell!uw-beaver!tektronix!hplabs!sri-unix!phil@RICE.ARPA From: phil@RICE.ARPA Newsgroups: net.lang.c Subject: Re: Varargs in C Message-ID: <13068@sri-arpa.UUCP> Date: Sat, 1-Sep-84 18:13:01 EDT Article-I.D.: sri-arpa.13068 Posted: Sat Sep 1 18:13:01 1984 Date-Received: Mon, 3-Sep-84 11:38:02 EDT Lines: 22 From: William LeFebvre > As for type information for each argument, it is not clear that this is > useful in most cases... The callee would either ignore it, or blow up if > it is wrong (at great expense of decoding the type info...). What about arguments of different sizes? On a VAX, everything is passed on the stack in four bytes, except for floating point numbers (such as a "double"). If your stack frame tells you the number of bytes that were passed to a routine, you would still not be able to tell how many arguments were passed, because you don't know the size of each argument. The type information would tell you. In fact, even if you had both the number of bytes and the number of arguments, you still wouldn't be able to pull out the appropriate arguments in all cases. As an example, if the caller passes an int and a double, the function still won't know which order they were passed in, despite the fact that he knows that there are 2 arguments and 12 bytes. William LeFebvre Department of Computer Science Rice University