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=0.6 required=5.0 tests=BAYES_00,TO_NO_BRKTS_FROM_MSSP autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,13703514e3723cbe X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-17 11:17:29 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.news.rcn.net!rcn!dca6-feed2.news.digex.net!lax2-feed1.news.digex.net!intermedia!news-out.spamkiller.net!propagator-la!news-in.superfeed.net!newsranger.com!www.newsranger.com!not-for-mail Newsgroups: comp.lang.ada From: Ted Dennison References: <9l7qon$d78$1@nntp9.atl.mindspring.net> <9li279$mhm$1@slb2.atl.mindspring.net> <3B7D4894.C342A35C@boeing.com> Subject: Re: C-style 'union' in Ada? Message-ID: X-Abuse-Info: When contacting newsranger.com regarding abuse please X-Abuse-Info: forward the entire news article including headers or X-Abuse-Info: else we will not be able to process your request X-Complaints-To: abuse@newsranger.com NNTP-Posting-Date: Fri, 17 Aug 2001 14:17:12 EDT Organization: http://www.newsranger.com Date: Fri, 17 Aug 2001 18:17:12 GMT Xref: archiver1.google.com comp.lang.ada:12067 Date: 2001-08-17T18:17:12+00:00 List-Id: 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