comp.lang.ada
 help / color / mirror / Atom feed
From: Thomas Handler <th@umundum.vol.at>
Subject: Re: accesibility level problem
Date: 1999/02/21
Date: 1999-02-21T00:00:00+00:00	[thread overview]
Message-ID: <36D06C0F.32CA8C6B@umundum.vol.at> (raw)
In-Reply-To: 36CDE45C.5B5E04D8@lmco.com

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




  parent reply	other threads:[~1999-02-21  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
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 [this message]
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