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:07:04 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!bigfeed2.bellsouth.net!news.bellsouth.net!elnk-atl-nf1!newsfeed.earthlink.net!stamper.news.atl.earthlink.net!newsread1.news.atl.earthlink.net.POSTED!d9c68f36!not-for-mail Message-ID: <3FEC4E89.2070804@noplace.com> From: Marin David Condic User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 (OEM-HPQ-PRS1C03) 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> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 26 Dec 2003 15:07:03 GMT NNTP-Posting-Host: 209.165.27.43 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.news.atl.earthlink.net 1072451223 209.165.27.43 (Fri, 26 Dec 2003 07:07:03 PST) NNTP-Posting-Date: Fri, 26 Dec 2003 07:07:03 PST Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:3814 Date: 2003-12-26T15:07:03+00:00 List-Id: My point is that there isn't such a thing as "Pascal" or "C" in this respect. There's only some specific *implementation* of Pascal or C. If you had a Pascal interpreter, it might not be doing anything with pushing and popping parameters on a stack - at least not in any way that the programmer could hope to control. Someone could write a C compiler that wrote its parameters out to paper tape starting from the middle and alternating left and right - why? Maybe just to prove it could be done. Implementations on unusual architectures might do unusual things and it is an error in thinking that C or Pascal or Ada passes parameters in any specific way when there is nothing in the language definition to give one reason to think so. 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..." when in reality it is "This particular version of this particular compiler for this particular language on this particular platform - does this..." There is no rule that I know of that dictates that C, Pascal or Ada must evaluate and stack up parameters in some specific order, nor, AFAIK, was there ever any validation suite to insure that they did. Any presumption that it will be done one way or another is thus quite misleading. MDC Hyman Rosen wrote: > > In an older, simpler world, Pascal pushed its arguments left-to-right and > the called routine popped the stack, while C pushed its arguments right-to- > left and the calling routine popped the stack. The C way allows for easy > handling of variable sized argument lists, and for the caller not to care > how many arguments the called routine expects and for the called routine > not to care how many arguments it was actually called with. > -- ====================================================================== Marin David Condic I work for: http://www.belcan.com/ My project is: http://www.jsf.mil/NSFrames.htm Send Replies To: m o d c @ a m o g c n i c . r "Face it ladies, its not the dress that makes you look fat. Its the FAT that makes you look fat." -- Al Bundy ======================================================================