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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a88e582de42cdc9b X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!i12g2000prf.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Bug in Ada (SuSe 10.2) ? Date: Thu, 6 Mar 2008 09:46:50 -0800 (PST) Organization: http://groups.google.com Message-ID: <96803815-90ec-4798-8202-4f26cc7103f2@i12g2000prf.googlegroups.com> References: <0_mdna0iHpIsCifaRVnzvQA@telenor.com> <48277611-402f-4622-be05-6edddf6dd56a@o10g2000hsf.googlegroups.com> <624tcvF21i3nvU1@mid.individual.net> <2630d99b-1578-4d79-ac9c-64c00c203b77@e60g2000hsh.googlegroups.com> <69019a65-736e-48ee-bd9f-4c29cd7fc88f@72g2000hsu.googlegroups.com> <48a0a0c4-7b79-42dc-b541-7a68693bdd4c@e41g2000hsc.googlegroups.com> <626c2f0a-d308-437d-888e-0f3ced336f01@f47g2000hsd.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1204825611 8011 127.0.0.1 (6 Mar 2008 17:46:51 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 6 Mar 2008 17:46:51 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: i12g2000prf.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:20198 Date: 2008-03-06T09:46:50-08:00 List-Id: On Feb 27, 4:30 pm, "Randy Brukardt" wrote: > Why do you think a compile-time message is a bug? I've convinced myself that > it is correct. Look at the body of WoW closely: > > function WoW (Slats: access AirSpeed) return Int_Access is > begin > return Slats.Altitude'Access; > end WoW; > > Since Slats is an access value, this is really a dereference. That is, the > return statement really is: > > return Slats.all.Altitude'Access; > > And you lose the special (dynamic) accessibility with the dereference. Thus, > you get a static check (which fails in this case). I wasn't paying much attention to this thread; but I've had an occasion to take a second look at this, and this doesn't seem right. 3.10.2(15) says that the accessibility level of a view of a dereference is the same as the accessibility level of that of the access type, which in this case is the anonymous access type of the access parameter. And 3.10.2(19) says that the "statically deeper" relationship doesn't apply to the accessibility level of the anonymous type of the access parameter; I would think 3.10.2(19) would apply equally to the dereference (Slats.all) as it does to the parameter (Slats), since 3.10.2(15) says their accessibility levels are the same. In other words, I don't see from the RM how a dereference causes you to lose the dynamic accessibility check. Now I know that I don't get 3.10.2 right all the time---I've embarrassed myself more than once on Ada-Comment by misinterpreting this section. And sometimes I just miss rules. But if I'm wrong, and I haven't missed a rule, then this is disturbing, because it means that the legality of a certain fairly simple construct can't be determined by reading the RM---it requires some subtle interpretation that is accessible (no pun intended) only to a select few. In any case, I don't see any reason why the construct in the above example shouldn't be legal (with a dynamic check); the functionality seems useful and not at all dangerous. -- Adam