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,9640b17421044f1a X-Google-Attributes: gid103376,public From: Thomas Handler Subject: Re: accesibility level problem Date: 1999/02/21 Message-ID: <36D06C0F.32CA8C6B@umundum.vol.at>#1/1 X-Deja-AN: 446793973 Content-Transfer-Encoding: 7bit References: <36CD206A.32D96489@systems.at> <36CDE45C.5B5E04D8@lmco.com> Content-Type: text/plain; charset=us-ascii Organization: Toemmsn's Homeoffice Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-02-21T00:00:00+00:00 List-Id: Hi Steve, steve quinlan wrote: > > My version of GNAT (3.11b) gives a different message : > > Non-local pointer cannot point to local object so does mine (3.11p) ;-) > > I think this is just standard accessibility rules. The type channelp is > defined at a package level, the object you are aliasing is defined locally > in a subprogram. It has a deeper level than the acces type -- it could go > out of scope, but objects of that access type could still be in scope, and > you could possibly assign the address of the object to a value of the access Hmm, sounds as if I have missed something though I have read this chapter more than twice ;-) > type, thus creating the problem of an invalid reference. The accessibility > rules prevent even the possibility of this happening by not allowing > conversion of an access-to-object to a pointer-to-object when the pointer > may outlive the object (I think). So, it's an appropriate case for > unchecked_access. OK, thank you very much for this description! > > You'd just want to make sure that in AwaitChannels, you don't save any of > those references in, say, some package body state variable. That could > generate the invalid reference problem. This explanation makes accessibility rules even more clear for me. Once again thank you. Ciao, Thomas Handler