comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison<dennison@telepath.com>
Subject: Re: C-style 'union' in Ada?
Date: Fri, 17 Aug 2001 18:17:12 GMT
Date: 2001-08-17T18:17:12+00:00	[thread overview]
Message-ID: <Icdf7.5156$2u.50843@www.newsranger.com> (raw)
In-Reply-To: 3B7D4894.C342A35C@boeing.com

In article <3B7D4894.C342A35C@boeing.com>, Jeffrey Carter says...
>
>Unchecked_Conversion is allowed to return its result "by reference".
>This allows a good compiler to avoid assignment when possible.

Really? I wouldn't think that's possible, since the source and target are going
to be distinct objects with discinct storage addresses. Clearly the data isn't
getting from one to the other without a copy happening somewhere.

If you are talking about doing something like accessing a field after an
unchecked_conversion, eg. doing a: 
if Convert_To_String (Big_Hairy_Record)(1) = 'a' then ...

then I could see it. However, I know the one time I checked into it (on the DEC
Ada83 compiler), it would put a full copy on the stack even in this instance.
Does anyone know what some of the modern compilers do?

---
T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html
          home email - mailto:dennison@telepath.com



  reply	other threads:[~2001-08-17 18:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-13  6:06 C-style 'union' in Ada? Brian Catlin
2001-08-13  7:34 ` tmoran
2001-08-14  3:09 ` DuckE
2001-08-14  3:49   ` Brian Catlin
2001-08-14  7:37     ` Martin Dowie
2001-08-14  9:39       ` Ole-Hjalmar Kristensen
2001-08-14 11:49         ` Martin Dowie
2001-08-14 13:38 ` Ted Dennison
2001-08-16 22:35   ` David Brown
2001-08-17  3:14     ` Brian Catlin
2001-08-17 14:44       ` Ted Dennison
2001-08-17 16:38         ` Jeffrey Carter
2001-08-17 18:17           ` Ted Dennison [this message]
2001-08-17 18:45         ` Samuel T. Harris
2001-08-17  3:18     ` Variable sizes for record fields (was: C-style 'union' in Ada) Larry Kilgallen
2001-08-17  6:34       ` Variable sizes for record fields David Brown
2001-08-17 10:44         ` Larry Kilgallen
2001-08-17 19:18           ` Warren W. Gay VE3WWG
2001-08-17 21:36             ` Ken Burtch
replies disabled

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