From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 X-Received: by 2002:ac8:7ca1:: with SMTP id z1mr19027021qtv.254.1618947679779; Tue, 20 Apr 2021 12:41:19 -0700 (PDT) X-Received: by 2002:a25:ccc1:: with SMTP id l184mr27262267ybf.165.1618947679628; Tue, 20 Apr 2021 12:41:19 -0700 (PDT) Path: eternal-september.org!reader02.eternal-september.org!news.uzoreto.com!news.karotte.org!news2.arglkargh.de!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 20 Apr 2021 12:41:19 -0700 (PDT) In-Reply-To: Injection-Info: google-groups.googlegroups.com; posting-host=35.245.252.196; posting-account=XfA3zgkAAABoz6fRf3Tehtnqqr7Ycml- NNTP-Posting-Host: 35.245.252.196 References: <962020bb-97fc-42c3-8255-8f9b2bcbe204n@googlegroups.com> <13f272e5-14a3-45cb-abf2-3d9f5a98f715n@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <07a090e1-85b4-4ebb-a093-dcda57b56579n@googlegroups.com> Subject: Re: 'address on a subprogram parameter From: Vincent Marciante Injection-Date: Tue, 20 Apr 2021 19:41:19 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:61874 List-Id: On Tuesday, April 20, 2021 at 3:25:25 PM UTC-4, Randy Brukardt wrote: > "Vincent Marciante" wrote in message=20 > On Tuesday, April 20, 2021 at 12:35:07 PM UTC-4, J-P. Rosen wrote:=20 > > Le 20/04/2021 =C3=A0 17:10, Vincent Marciante a =C3=A9crit :=20 > > > I think that I used to know this but currently am not sure:=20 > > >=20 > > > Assuming the a value is passed by reference, > You can only assume that for by-reference types (see RM 6.3(4-9)).=20 >=20 > Your example just used an unspecified record type. For any old record typ= e=20 > (not in that list), the parameter passing mechanism is unspecified. Which= =20 > means a compiler can pass by copy if it wants (it *probably* will pass by= =20 > reference, but that's not the same as being required to do so). And if it= =20 > does, your assumption doesn't hold.=20 >=20 > For instance, for a small record like:=20 > type Screen_Position is=20 > X, Y : System.Byte; -- A Janus/Adaism, but I think you get the point.=20 > end record;=20 > it might make more sense to pass by copy (especially if registers are use= d=20 > in the usual calling convention).=20 >=20 > Randy. Got it (and "no way" that the big record that is in the real code would be = passed by copy but I'll see if specifying it explicitly would not be disruptive). Thanks.