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!news1.google.com!news.glorb.com!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? (follow up to yesterday's question) Date: Thu, 27 May 2004 19:07:29 +0200 Organization: AdaCL Message-ID: <3530449.K4d6KCzPc5@linux1.krischik.com> References: <75s9b0pgo91ctvlm5op2rcql82t9ip4me2@4ax.com> 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 1085677949 01 14088 TY1zGsh1UVcw0-8 040527 17:12:29 X-Complaints-To: usenet-abuse@t-online.de X-ID: XRTEUsZ6wewRw2WW2+cvJiThXPlmzTu2ILSCwi470bbZLlxU9g7BEA User-Agent: KNode/0.7.7 Xref: controlnews3.google.com comp.lang.ada:881 Date: 2004-05-27T19:07:29+02:00 List-Id: James Alan Farrell wrote: > Hello again, > This is a followup to the question I asked yesterday. Below is a bit > of code from GNAT's ASIS library. (I imagine this was written by > people with a lot more expertise in Ada than I have, and that this > code is okay.) > > It has a declarative part in the middle of the code, in which a > variable (Result) is declared. The stuff in that variable is > returned. > > Now its my understanding that when variables are declared like this, > they are added onto the stack, then when the function returns, they > are popped off again, along with the regular stack frame. So the > stuff returned goes away. In addition to the other explanation you should be aware the the way this is done depends if convention C, Ada or DLL is used. I have made good experience with passing from Ada to C using convention DLL. Convention C has not worked with all C compilers on Windows. With Regards Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com