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=-0.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no 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 11:05:22 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!in.100proofnews.com!in.100proofnews.com!cycny01.gnilink.net!cyclone1.gnilink.net!spamkiller2.gnilink.net!nwrdny01.gnilink.net.POSTED!0f19ed38!not-for-mail From: "Frank J. Lhota" Newsgroups: comp.lang.ada 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> <1072891494.595791@master.nyc.kbcfp.com> Subject: Re: GNAT parameter passing, C-style? X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Message-ID: Date: Wed, 31 Dec 2003 19:05:21 GMT NNTP-Posting-Host: 151.203.242.46 X-Complaints-To: abuse@verizon.net X-Trace: nwrdny01.gnilink.net 1072897521 151.203.242.46 (Wed, 31 Dec 2003 14:05:21 EST) NNTP-Posting-Date: Wed, 31 Dec 2003 14:05:21 EST Xref: archiver1.google.com comp.lang.ada:3997 Date: 2003-12-31T19:05:21+00:00 List-Id: "Hyman Rosen" wrote in message news:1072891494.595791@master.nyc.kbcfp.com... > 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. Thanks for the example. This is a case where I'm glad to be proved wrong, for it always seemed wasteful to force the C calling convention when it is not necessary. Does the Sun compiler have a command line option for compiling vanilla C programs? This would an ideal solution to handling both legacy and ANSI C code.