Path: utzoo!utgpu!water!watmath!clyde!rutgers!cmcl2!brl-adm!brl-smoke!gwyn From: gwyn@brl-smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c++ Subject: Re: Ansi C compatibility Message-ID: <6961@brl-smoke.ARPA> Date: 6 Jan 88 09:42:41 GMT References: <590@PT.CS.CMU.EDU> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 19 In article <590@PT.CS.CMU.EDU> dld@F.GP.CS.CMU.EDU (David Detlefs) writes: >We're operating under the assumption that any ANSI-C compiler will >define "_ansi_c_", and will modify any of those (as well as CC) >locally to do this. Does anyone have a better idea? Yes, how about using the symbol __STDC__ that an ANSI C implementation is required to provide a predefinition for? >P.S. Can someone explain to me the rationale behind the ANSI >decision? I understand that it has something to do with varargs, but >I don't know what. The ANSI restriction that there must be at least >one fixed argument seems obviously artificial. Some implementations would much prefer to pass "normal" non-variadic arguments in a different, more efficient way than what they would have to use for variadic arguments. The fixed argument is for an "anchor" to help va_start locate the first variadic argument; this could be done with the help of compiler intrinsics, but it was felt that many implementations would not need such kludges if an anchor were present.