Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!columbia!rutgers!clyde!watmath!watnot!watrose!rbutterworth From: rbutterworth@watrose.UUCP (Ray Butterworth) Newsgroups: comp.lang.c Subject: Re: varargs in the world Message-ID: <8276@watrose.UUCP> Date: Thu, 20-Nov-86 11:16:10 EST Article-I.D.: watrose.8276 Posted: Thu Nov 20 11:16:10 1986 Date-Received: Fri, 21-Nov-86 00:51:39 EST References: <1538@batcomputer.tn.cornell.edu> Organization: U of Waterloo, Ontario Lines: 26 > Are there any compilers/RTL's out there which do *not* support "varargs"? There are a few. In the future there will be many more. The proposed ANSI X3J11 C standard has put into its library, and added "extern int func(arg1,arg2,...);" to the C language. (The "..." in that example really is entered into the source as three dots.) This is an improvement over the approach, but it is not compatible with it (in particular since there has to be at least one parameter before the ",..." part). On any machine and compiler a varargs.h could probably be implemented, but it would have to be very machine specific (e.g. is it the caller or the function that allocates stack space for the arguments? or does that type of function simply get passed a pointer to a variable length list of arguments?). It could not be done by using the definitions. It might need some assembly language functions for accessing the arguments. It is even possible that a strict X3J11 compiler would reject any function call that contains a different number of arguments if that function is not declared with the ",..." syntax. The varargs and the stdarg macros are very similar, but they are different. Converting source code from one to the other is fairly trivial, but it is still something that has to be done by hand.