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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ede2fcfbef7f3092 X-Google-Attributes: gid103376,public Path: controlnews3.google.com!postnews1.google.com!not-for-mail From: cyanobact@hotmail.com (Jo) Newsgroups: comp.lang.ada Subject: Re: "out" parameters Date: 28 May 2004 16:14:57 -0700 Organization: http://groups.google.com Message-ID: References: <14098638.pGWFRt1ihv@linux1.krischik.com> NNTP-Posting-Host: 142.73.138.136 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1085786097 14815 127.0.0.1 (28 May 2004 23:14:57 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 28 May 2004 23:14:57 +0000 (UTC) Xref: controlnews3.google.com comp.lang.ada:899 Date: 2004-05-28T16:14:57-07:00 List-Id: Martin Krischik wrote in message news:<14098638.pGWFRt1ihv@linux1.krischik.com>... > Jo wrote: > > > Does anyone happen to know whether an "out" parameter in Ada is being > > passed by-copy or by-reference? > > > > If the parameter is a record with neither elementary nor access type > > component in it, then is it true that whether the "out" parameter is > > passed by-copy or by-reference is totally compiler dependent? > > It is not compiler dependent. There are rules. Within the rules the compiler > will do what is best. > > If you need to force him to use a specific calling convetion you can use > "pragma Convention" or "pragma Export" described in the chapter for > interfacing with other languages. But don't do it unless you have too or > for training. > > With Regards > > Martin If the compiler, within the rules, does what it thinks it's the best, it implies that it is, at least to a certain extent, compiler dependent. If I have a record that contains 2 fields, I initialize the 1st field, I then pass the record as an 'out' parameter to a subprogram. The subprogram assigns a value to the 2nd field and returns. If the record has neither elementary nor access type in it, then the compiler may have the flexibility to decide how it wants to pass the record. The question is, what value should I expect for the 1st field in the record when the subprogram returns? Regards, Jo