Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!rice!hsdndev!cmcl2!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: Do you use stdarg, varargs or ya-args? Message-ID: <16107@smoke.brl.mil> Date: 10 May 91 23:30:21 GMT References: <2755@muffin.cme.nist.gov> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 22 In article <2755@muffin.cme.nist.gov> libes@cme.nist.gov (Don Libes) writes: >All the STDC (-like) compilers I use support varargs. Not all the standard-conforming compilers that *I* use! >Yes, programs that use varargs are not conforming, but we (and I'm >speaking strictly for my coworkers here) are trying for maximal >portability in unknown environments. Either there is a curious irony >here or I don't understand why STDC invented stdarg. X3J11 invented ,...) and because there was a need for them in some implementation environments, and the va_start macro did not have a slot for the crucial "hook" on a known parameter that is needed by some reasonable implementations. For portability, you need to code for three environments: (a) exists; you can rely on this #if __STDC__. (b) exists; you can almost rely on this #if unix. (c) neither header exists; you might be able to provide your own implementation of for such an environment, or you could try pretending that there are more arguments than needed, which is a kludge that works in many cases.