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,2866100c9a2b8ce7 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Type conversion between access types (was: Free'ing extended types) Date: 1996/05/21 Message-ID: #1/1 X-Deja-AN: 155861532 references: <3183AC75.335C@ehs.ericsson.se> <3184803D.1208@ehs.ericsson.se> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-05-21T00:00:00+00:00 List-Id: In article , Scott Leschke 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