comp.lang.ada
 help / color / mirror / Atom feed
From: steve quinlan <steven.quinlan@lmco.com>
Subject: Re: accesibility level problem
Date: 1999/02/19
Date: 1999-02-19T00:00:00+00:00	[thread overview]
Message-ID: <36CDE45C.5B5E04D8@lmco.com> (raw)
In-Reply-To: 36CD206A.32D96489@systems.at

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.





  reply	other threads:[~1999-02-19  0:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-19  0:00 accesibility level problem Thomas Handler
1999-02-19  0:00 ` steve quinlan [this message]
1999-02-20  0:00   ` robert_dewar
1999-02-20  0:00     ` Steve Quinlan
1999-02-21  0:00       ` robert_dewar
1999-03-01  0:00     ` Robert A Duff
1999-03-02  0:00       ` Thomas Handler
1999-02-21  0:00   ` Thomas Handler
1999-02-21  0:00     ` Steve Quinlan
1999-02-22  0:00       ` robert_dewar
1999-02-22  0:00     ` robert_dewar
1999-02-22  0:00       ` Thomas Handler
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox