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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,195bd8ec4227e968 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-02-11 16:21:58 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!border1.nntp.sjc.giganews.com!nntp.giganews.com!local1.nntp.sjc.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Wed, 11 Feb 2004 18:21:55 -0600 Date: Wed, 11 Feb 2004 19:21:54 -0500 From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: [Q] non-limited record and "self-pointer" References: <86d68pl0tc.fsf@sonnenregen.at.home> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 24.147.77.160 X-Trace: sv3-52TyOa6qphRLhPPWlfTrvekYlpGZvvQg0Bbv7sR3dDpEcmer10eVBDUvMr/lh2IFPlefLXPP0stcrwn!W+I19PnpbYgG2Xyf0Fbgf3qEMZvMmLRijp9FaDkhgrflx7u32EZJa8zSeXFnjQ== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: archiver1.google.com comp.lang.ada:5464 Date: 2004-02-11T19:21:54-05:00 List-Id: Georg Bauhaus wrote: > Robert I. Eachus wrote: > : Stephen Leake wrote: > : > : > :> This definitely looks like a compiler bug. Perhaps because Container > :> is tagged, Read_Only_Set is being labeled "aliased". But that's not in > :> the ARM. > : > : I don't see that. 3.10(9) says in part: "Finally, the current instance > : of a limited type, and a formal parameter or generic formal object of a > : tagged type are defined to be aliased." > > Thanks for the answers. Still I wonder what is going on here. In Dan > Eilers' example there is no parameter. It is just the Controlled > component which seems to make the compiler happy. If the "container" > component is replaced with a component of some tagged type other > than one derived from Controlled, the self reference is not allowed, > according to the compiler. > > Am I missing something? Um, aliased should be an attribute of (sub)types and objects. But current language definition gets it wrong. (Maybe I should say incompletely right? ;-) In this case, there is an implementation freedom with Controlled that is totally bogus. Implementations may (and as far as I know all implementations do) require that objects or components of a controlled type are aligned so that they may be aliased. (Can be designated by an access object.) The problem is that the VIEW of that type may or may not be aliased. Hmmm. That is really obtuse, as far as this example is concerned. Assume that the compiler has an alignment clause for Controlled that causes all controlled objects to be CAPABLE of being aliased. Since the possible alignments for Read_Only_Set are a subset of the alignments for Controlled, there will usually be no problems dectected for the type declaration. However, as I understand Dan Eilers example, any objects of Read_Only_Set would either have to be explicitly aliased, or explicitly initialized. But since aliased is a property of objects in general not types, the compiler has to wait until a Read_Only_Set object is declared to see if the initial value expression is ever used on a non-aliased view of an object. -- Robert I. Eachus "The war on terror is a different kind of war, waged capture by capture, cell by cell, and victory by victory. Our security is assured by our perseverance and by our sure belief in the success of liberty." -- George W. Bush