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: steve quinlan Subject: Re: accesibility level problem Date: 1999/02/19 Message-ID: <36CDE45C.5B5E04D8@lmco.com>#1/1 X-Deja-AN: 446220815 Content-Transfer-Encoding: 7bit References: <36CD206A.32D96489@systems.at> Content-Type: text/plain; charset=us-ascii Organization: Lockheed-Martin Air Traffic Management Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-02-19T00:00:00+00:00 List-Id: My version of GNAT (3.11b) gives a different message : Non-local pointer cannot point to local object 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 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. 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.