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,FREEMAIL_FROM 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 09:25:01 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!priapus.visi.com!orange.octanews.net!news.octanews.net!news-out.visi.com!petbe.visi.com!ash.uu.net!spool.news.uu.net!not-for-mail Date: Wed, 31 Dec 2003 12:24:54 -0500 From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031013 Thunderbird/0.3 X-Accept-Language: en-us, en MIME-Version: 1.0 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> <4iBIb.8173$qS3.498@nwrdny03.gnilink.net> <1072883131.278899@master.nyc.kbcfp.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Message-ID: <1072891494.595791@master.nyc.kbcfp.com> Cache-Post-Path: master.nyc.kbcfp.com!unknown@nightcrawler.nyc.kbcfp.com X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1072891494 11498 204.253.250.10 Xref: archiver1.google.com comp.lang.ada:3996 Date: 2003-12-31T12:24:54-05:00 List-Id: Frank J. Lhota wrote: > I go back to my original question: does anyone know of a C compiler which, > when compiling C (not C++) does not default to the C calling convention > (i.e. arguments pushed on the stack in reverse order, and popped off by > calling function) in the absence of any indication of another convention? Certainly. Here's partial output of such code compiled on a Sun with the simple invocation 'cc -S g.c'. As you can see, arguments are passed in registers and processed left-to-right. main: save %sp,-104,%sp .L15: ! File g.c: ! 1 extern int f(); ! 2 int main() ! 3 { ! 4 return f(1, 2.0, 3, 4.0); mov 1,%o0 sethi %hi(.L_cseg0),%l0 or %l0,%lo(.L_cseg0),%l0 ldd [%l0+0],%f2 mov 3,%o3 ldd [%l0+8],%f4 std %f2,[%sp+88] ld [%sp+88],%o1 ld [%sp+92],%o2 std %f4,[%sp+88] call f ldd [%sp+88],%o4 ba .L14 mov %o0,%l0 ! block 2 .L14: mov %l0,%i0 jmp %i7+8 restore