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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,984d3d7860d7c8c X-Google-Attributes: gid103376,public Path: controlnews3.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: Where are returned values stored? Date: Sun, 30 May 2004 09:10:38 +0200 Organization: AdaCL Message-ID: <1172962.5YVFDR7a85@linux1.krischik.com> References: <75s9b0pgo91ctvlm5op2rcql82t9ip4me2@4ax.com> <1dptc.49822$tb4.1731604@news20.bellglobal.com> <2lNtc.56154$tb4.2140194@news20.bellglobal.com> <60328483.MtZnWf8h2m@linux1.krischik.com> <3bxeqHcbeKgM@eisner.encompasserve.org> Reply-To: krischik@users.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.t-online.com 1085901325 03 7040 4Mb4GvClrNt30qX 040530 07:15:25 X-Complaints-To: usenet-abuse@t-online.de X-ID: SPnIgTZQoe2wWRNekXdPe21kizVZrIWVW82IqHfnoTCbDxEi7Gjxkj User-Agent: KNode/0.7.7 Xref: controlnews3.google.com comp.lang.ada:922 Date: 2004-05-30T09:10:38+02:00 List-Id: Larry Kilgallen wrote: > In article <60328483.MtZnWf8h2m@linux1.krischik.com>, Martin Krischik > writes: >> Warren W. Gay VE3WWG wrote: >> >>> > Interesting to consider this with a recursive procedure, but yes, it >>> > should work. >>> > >>> > JAF >>> >>> Calling Conventions: >>> >>> If this indeed happens (on a given platform), I would think >>> that the calling convention used is +critical+. For example, >>> if you forced an Ada routine to use the C calling convention, >>> I would bet that on most platforms, that all return values >>> must be _copied_ or placed on the heap (temporarily). At least >>> this would be true for strings/arrays etc. where the size >>> was not known in advance. > > Just jumping in, this seems to be an OS-independent discussion. The OP is involved in C - Ada mixed language programming. >> The "C" calling convention places the return value inside a hidden static >> variable. A pointer to this variable is then returned. > > I am not sure what you mean by "the" C calling convention. Whatever K&R though is practical for there programming language. For use from Ada see also RM B.3 (1/1). > Certainly on VMS C obeys the OS calling convention for all inter-module > calls, just as other languages do. As does Windows and OS/2. It seems that almost everywhere the C compilers don't use calling convention "C" anymore for anything but printf and scanf. With Regards Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com