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-26 07:39:29 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!newsfeed2.easynews.com!easynews.com!easynews!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: "Luke A. Guest" Newsgroups: comp.lang.ada Subject: Re: GNAT parameter passing, C-style? Date: Fri, 26 Dec 2003 15:39:28 +0000 Message-ID: References: <3FEC43B2.5080606@noplace.com> <1072450300.440355@master.nyc.kbcfp.com> <3FEC4E89.2070804@noplace.com> NNTP-Posting-Host: abyss2.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.demon.co.uk 1072453169 7819 62.49.62.197 (26 Dec 2003 15:39:29 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Fri, 26 Dec 2003 15:39:29 +0000 (UTC) User-Agent: Pan/0.14.0 (I'm Being Nibbled to Death by Cats!) Xref: archiver1.google.com comp.lang.ada:3815 Date: 2003-12-26T15:39:28+00:00 List-Id: On Fri, 26 Dec 2003 15:07:03 +0000, Marin David Condic wrote: > We often seem to see this kind of misunderstanding - that someone's > experience with one specific implementation (or even several common > implementations) starts becoming "Ada does this..." or "C does that..." It's not a misunderstanding, it's part of the C standard spec and compilers still do it. Some compilers do put their parameters into registers, on some machines with some compilers, they start in registers and then carry on into the stack. The only platform I ever saw that always used registers (unless it ran out of them) was the AmigaOS and any compiler that could take in the #?.fd files and make direct calls to the libraries based on these specs. Now, with that in mind, I have found it in the Ada RM and you can use the convention pragma to control it, although with GNAT under Linux it's generated code doesn't seem to change. This is also probably due to the fact that it's part of GCC and maybe the backend always tries to generate C-like calling convention. Under different Ada compilers this might be different, I don't know. Luke.