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=2.2 required=5.0 tests=BAYES_00,FROM_WORDY, REPLYTO_WITHOUT_TO_CC 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 18:51:03 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!rcn!feed3.news.rcn.net!not-for-mail Reply-To: "Frank J. Lhota" 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> <1072899508.453543@master.nyc.kbcfp.com> <1072906542.723974@master.nyc.kbcfp.com> Subject: Re: GNAT parameter passing, C-style? Date: Wed, 31 Dec 2003 21:50:59 -0500 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: <3ff38b16$0$4759$61fed72c@news.rcn.com> NNTP-Posting-Host: 209.6.176.101 X-Trace: 1072925462 reader3.news.rcn.net 4759 209.6.176.101:2173 X-Complaints-To: abuse@rcn.com Xref: archiver1.google.com comp.lang.ada:4005 Date: 2003-12-31T21:50:59-05:00 List-Id: "Hyman Rosen" wrote in message news:1072906542.723974@master.nyc.kbcfp.com... > Frank J. Lhota wrote: > > Of course, passing parameters by registers avoids all of these issues, > > since nothing is pushed onto or popped off the stack. > > On the contrary, using registers exacerbates these issues, since > there can never be enough registers to hold all possible arguments. > If you call a function with enough parameters, eventually there will > be too many to fit, and the remaining arguments will be passed on the > stack. The "stdarg.h" header is meant to be implementation magic; the > compiler knows all about the particular paramater passing scheme, and > will fix things up as needed to make it all work. To be more precise, for functions with only a few arguments, these issues do not arise. I am curious, however, as to how the Sun compiler handles parameter lists long enough to exhaust available registers. My guess is that those parameters not passed via registers are pushed on the stack in reverse order, and are popped off by the calling function. I'm also curious as to how the Sun version of handles a combination of register and stack parameters. I imagine that they must use some implementation-specific extension to implement .