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,1054df2e2c490eda X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Q: Memory management Date: 1996/06/25 Message-ID: #1/1 X-Deja-AN: 162066270 references: <9606241936.AA11042@most> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-06-25T00:00:00+00:00 List-Id: In article , Hannes Haug wrote: > Wes> X'Address and X(X'First)'Address should be identical, too, > Wes> unless ... > >Is this true if you deal with unconstrained arrays ? 13.3(14) says X'Address should point at the first component of the array. This is "merely" Implementation Advice. But I don't see any reason why a compiler would not obey -- and if it didn't, I would consider it a bug. >... The bounds have >to be stored at the beginning of the array. They don't *have* to be. That's just the typical implementation of access-to-unconstrained-arrays. I believe GNAT doesn't do it that way, though. On the other hand, the typical implementation of an unconstrained array formal parameter is to pass the bounds separately from the data, and to pass the data by reference. >... I think that X'Address >would give you the address of the location where the bounds are stored. Some Ada 83 compilers did this. In Ada 95, however, it should not be true. On the other hand, if you have discriminants or a Tag field, then the RM doesn't say anything. See 13.3(14.a). - Bob