comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Q: Memory management
Date: 1996/06/25
Date: 1996-06-25T00:00:00+00:00	[thread overview]
Message-ID: <DtK5LL.G65@world.std.com> (raw)
In-Reply-To: uvvg27kjm35.fsf@chaq.informatik.uni-tuebingen.de


In article <uvvg27kjm35.fsf@chaq.informatik.uni-tuebingen.de>,
Hannes Haug  <Hannes.Haug@Student.Uni-Tuebingen.de> 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




  reply	other threads:[~1996-06-25  0:00 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-06-24  0:00 Q: Memory management W. Wesley Groleau (Wes)
1996-06-25  0:00 ` Jon S Anthony
1996-06-26  0:00   ` Robert Dewar
1996-06-25  0:00 ` Hannes Haug
1996-06-25  0:00   ` Robert A Duff [this message]
1996-06-25  0:00   ` Tucker Taft
     [not found]     ` <Dtzv4J.9FL@thomsoft.com>
1996-07-17  0:00       ` Robert Dewar
1996-06-27  0:00 ` Hannes Haug
     [not found] <JSA.96Jun26142033@organon.com>
1996-06-27  0:00 ` Hannes Haug
1996-06-27  0:00 ` Hannes Haug
1996-06-27  0:00   ` Robert A Duff
  -- strict thread matches above, loose matches on Subject: below --
1996-06-19  0:00 Q: memory management W. Wesley Groleau (Wes)
1996-06-20  0:00 ` Hannes Haug
1996-06-20  0:00 ` Hannes Haug
1996-06-20  0:00   ` Robert Dewar
1996-06-21  0:00 ` Hannes Haug
1996-06-21  0:00   ` Robert Dewar
1996-06-25  0:00 ` Hannes Haug
1996-06-15  0:00 Hannes Haug
1996-06-15  0:00 ` Jon S Anthony
1996-06-16  0:00   ` Robert Dewar
1996-06-18  0:00   ` Kent Mitchell
1996-06-15  0:00 ` Robert Dewar
1996-06-16  0:00 ` Hannes Haug
1996-06-17  0:00   ` Hannes Haug
1996-06-17  0:00   ` Tucker Taft
1996-06-18  0:00   ` Hannes Haug
1996-06-18  0:00     ` Tucker Taft
1996-06-19  0:00     ` Hannes Haug
1996-06-18  0:00 ` Jon S Anthony
replies disabled

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