From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Type conversion between access types (was: Free'ing extended types)
Date: 1996/05/21
Date: 1996-05-21T00:00:00+00:00 [thread overview]
Message-ID: <DrqLG3.1r0@world.std.com> (raw)
In-Reply-To: leschkes.832628057@ferret
In article <leschkes.832628057@ferret>,
Scott Leschke <leschkes@ferret.cig.mot.com> wrote:
>On a related but different note, I was wondering about the effect of the
>reserved word 'all' in the access type declarations below. First I was
>slightly surprised that the type conversions in the example code Bob Duff
>posted were allowed since I know that independent access types (even those
>specifying the same type) are viewed as denoting separate pools and as such
>type conversions between them is not allowed. This rule appears to go out
>the window though if the 'all' modifier is used as in Bob's example. To
>paraphrase Jerry Seinfeld, "What's the deal with that?"
Yes, if you add the 'all' modifier, the restriction goes "out the
window". You can convert *to* an 'all' access type, so long as the
designated subtypes match. But you had better be careful about storage
pools -- if you deallocate from the wrong type, it's erroneous.
>If you remove the 'all's from the declarations, the example ceases to
>compile using GNAT 3.03 SunOS 4.1.3 giving the error message:
Right.
>BTW, If this is by some off chance highlights a bug in GNAT, please accept
>my apologies up front for wasting bandwidth in this forum, but I don't
>believe it is.
I believe GNAT is correct here.
- Bob
next prev parent reply other threads:[~1996-05-21 0:00 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-04-28 0:00 Free'ing extended types Jonas Nygren
1996-04-28 0:00 ` Robert Dewar
1996-04-29 0:00 ` Laurent Guerby
1996-04-29 0:00 ` Robert A Duff
1996-04-29 0:00 ` Robert Dewar
1996-04-29 0:00 ` Laurent Guerby
1996-04-29 0:00 ` Robert A Duff
1996-04-29 0:00 ` Jonas Nygren
1996-04-29 0:00 ` Robert A Duff
1996-04-29 0:00 ` Robert Dewar
1996-04-29 0:00 ` Robert A Duff
1996-04-29 0:00 ` Jonas Nygren
1996-05-20 0:00 ` Type conversion between access types (was: Free'ing extended types) Scott Leschke
1996-05-21 0:00 ` Dale Stanbrough
1996-05-21 0:00 ` Robert A Duff
1996-05-21 0:00 ` Robert A Duff [this message]
1996-05-22 0:00 ` Scott Leschke
1996-05-23 0:00 ` Robert A Duff
1996-05-23 0:00 ` progers
1996-05-24 0:00 ` Scott Leschke
1996-05-24 0:00 ` Robert A Duff
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox