From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ac02560f0af03a21 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-31 02:23:15 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!elnk-pas-nf1!newsfeed.earthlink.net!cyclone.socal.rr.com!cyclone2.kc.rr.com!news2.kc.rr.com!twister.socal.rr.com.POSTED!53ab2750!not-for-mail Sender: kst@nuthaus.mib.org Newsgroups: comp.lang.ada Subject: Re: GNAT parameter passing, C-style? References: <3FEC43B2.5080606@noplace.com> <1072450300.440355@master.nyc.kbcfp.com> <3FEC4E89.2070804@noplace.com> <1072458199.346049@master.nyc.kbcfp.com> <3fec7c21$0$4764$61fed72c@news.rcn.com> From: Keith Thompson Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 31 Dec 2003 10:23:02 GMT NNTP-Posting-Host: 66.91.248.166 X-Complaints-To: abuse@rr.com X-Trace: twister.socal.rr.com 1072866182 66.91.248.166 (Wed, 31 Dec 2003 02:23:02 PST) NNTP-Posting-Date: Wed, 31 Dec 2003 02:23:02 PST Organization: RoadRunner - West Xref: archiver1.google.com comp.lang.ada:3980 Date: 2003-12-31T10:23:02+00:00 List-Id: "Frank J. Lhota" writes: > "Luke A. Guest" wrote > in message > news:pan.2003.12.26.17.27.26.494317@n_o_p_o_r_k_a_n_d_h_a_m.abyss2.demon.co.uk... > > On Fri, 26 Dec 2003 17:08:27 +0000, Luke A. Guest wrote: > > Just checked in there, but couldn't see it. Can't remember where I saw it > > then. Maybe it was a compiler book? > > I don't believe it was stated explicitly, but the standard C calling > convention (arguments pushed on the stack in reverse order, and popped off > by the callee) is implied by the requirements for variable argument > functions. [...] No, it isn't. In standard C, functions with variable argument lists have a special syntax ("..."), and don't have to use the same calling conventions as other functions. In the body of such a function, it accesses its arguments using special macros defined in the header ; these macros can do whatever compile-specific magic is necessary. In pre-standard "K&R" C, it was permissible to call a function with a variable argument list with no visible declaration of the function; making this work properly did place some constraints on the callng conventions. The ISO C standard was designed to remove these constraints. -- Keith Thompson (The_Other_Keith) kst-u@mib.org San Diego Supercomputer Center <*> Schroedinger does Shakespeare: "To be *and* not to be" (Note new e-mail address)