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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ddbf85842f937132 X-Google-Attributes: gid103376,public From: stt@houdini.camb.inmet.com (Tucker Taft) Subject: Re: Self-referential 'Access Date: 1998/04/20 Message-ID: #1/1 X-Deja-AN: 346035281 Sender: news@inmet.camb.inmet.com (USENET news) References: <353B4DC4.EB3650F4@ghg.net> X-Nntp-Posting-Host: houdini.camb.inmet.com Organization: Intermetrics, Inc. Newsgroups: comp.lang.ada Date: 1998-04-20T00:00:00+00:00 List-Id: Stanley Allen (sallen@ghg.net) wrote: : ... : The rules for "statically deeper" levels are given : under RM95:3.10.2(17). The only rule that seems : like it might apply here is RM95:3.10.2(21). : So, I have a few questions. : 1) Are the compilers in error, or is this code? The code is in error. : 2) If this code is in error, is it because of the : rule at paragraph (21)? Yes. : 3) If so, does this rule really make sense? : It does not seem right that these 'Access : references should be considered "deeper" than : the access type. The problem is that you are creating a value of a named access type. It is true that storing such references inside the object itself will not cause trouble. But because the access type is named, there is nothing precluding your copying their value into some other object of the same access type, with no further accessibility check. It is quite possible that that object might outlive the limited record object. : 4) Should the rule disallow only non-limited : records? The rule as written in justifiable, because there are no further checks when you copy the value from an object having a named access type. As pointed out in another response, you can use 'Unchecked_Access to bypass the check. You must still be careful not to copy the components into global variables that outlive the limited record object. : Stanley Allen : mailto:sallen@ghg.net -- -Tucker Taft stt@inmet.com http://www.inmet.com/~stt/ Intermetrics, Inc. Burlington, MA USA