comp.lang.ada
 help / color / mirror / Atom feed
From: Vincent Marciante <vincent.marciante@l3harris.com>
Subject: Re: 'address on a subprogram parameter
Date: Tue, 20 Apr 2021 12:41:19 -0700 (PDT)	[thread overview]
Message-ID: <07a090e1-85b4-4ebb-a093-dcda57b56579n@googlegroups.com> (raw)
In-Reply-To: <s5n9r3$crn$1@franka.jacob-sparre.dk>

On Tuesday, April 20, 2021 at 3:25:25 PM UTC-4, Randy Brukardt wrote:
> "Vincent Marciante" wrote in message 
> On Tuesday, April 20, 2021 at 12:35:07 PM UTC-4, J-P. Rosen wrote: 
> > Le 20/04/2021 à 17:10, Vincent Marciante a écrit : 
> > > I think that I used to know this but currently am not sure: 
> > > 
> > > Assuming the a value is passed by reference,
> You can only assume that for by-reference types (see RM 6.3(4-9)). 
> 
> Your example just used an unspecified record type. For any old record type 
> (not in that list), the parameter passing mechanism is unspecified. Which 
> means a compiler can pass by copy if it wants (it *probably* will pass by 
> reference, but that's not the same as being required to do so). And if it 
> does, your assumption doesn't hold. 
> 
> For instance, for a small record like: 
> type Screen_Position is 
> X, Y : System.Byte; -- A Janus/Adaism, but I think you get the point. 
> end record; 
> it might make more sense to pass by copy (especially if registers are used 
> in the usual calling convention). 
> 
> 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.

  reply	other threads:[~2021-04-20 19:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-20 15:10 'address on a subprogram parameter Vincent Marciante
2021-04-20 15:52 ` AdaMagica
2021-04-20 17:32   ` Jeffrey R. Carter
2021-04-21  9:19     ` AdaMagica
2021-04-20 17:33   ` Niklas Holsti
2021-04-20 16:35 ` J-P. Rosen
2021-04-20 17:18   ` Vincent Marciante
2021-04-20 19:25     ` Randy Brukardt
2021-04-20 19:41       ` Vincent Marciante [this message]
2021-04-24  1:25         ` Randy Brukardt
2021-04-24  9:56           ` Niklas Holsti
2021-04-21 20:17     ` Shark8
2021-04-22  9:54       ` Vincent Marciante
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox