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,9f3d09bde7b33b5d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-04-09 05:57:12 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: dan.r.mcleran@seagate.com (Dan McLeran) Newsgroups: comp.lang.ada Subject: Re: Pass by reference Date: 9 Apr 2004 05:57:11 -0700 Organization: http://groups.google.com Message-ID: <19b0e504.0404090457.52013e4@posting.google.com> References: <19b0e504.0404080652.4eab9f80@posting.google.com> NNTP-Posting-Host: 192.55.20.36 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1081515431 8306 127.0.0.1 (9 Apr 2004 12:57:11 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 9 Apr 2004 12:57:11 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:6901 Date: 2004-04-09T05:57:11-07:00 List-Id: > The Ada rules, simple version, for parameter passing mechanisms, are: > > Elementary types are always passed by copy. > > Tagged and private types are always passed by reference. > > Other types have the mechanism chosen by the compiler. That's what I thought. The RM is actually very clear about this, but it seems that alot of people assume compilers have more leeway. Alot of the answers indicate that people think the compiler is always free to choose the best convention. I don't believe this is true. A conforming compiler should do exactly what the RM says, which is what your short-version says. > The parameter mode (in, in out, and out) is completely unrelated to the > parameter passing mechanism. > > Generally, compilers do a good job of choosing the mechanism for "other > types". It might be informative to check the mechanism used for > > type T is array (1 .. Integer'Size) of Boolean; > pragma Pack (T); I'll check it out, Thanks.