comp.lang.ada
 help / color / mirror / Atom feed
From: stt@henning.camb.inmet.com (Tucker Taft)
Subject: Re: Q: Memory management
Date: 1996/06/25
Date: 1996-06-25T00:00:00+00:00	[thread overview]
Message-ID: <DtKt46.AJ9.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: uvvg27kjm35.fsf@chaq.informatik.uni-tuebingen.de


Hannes Haug (Hannes.Haug@Student.Uni-Tuebingen.de) wrote:
: >>>>> "Wes" == "W Wesley Groleau (Wes)" <wwgrol@PSESERV3.FW.HAC.COM> writes:

:     Wes> Hannes suggests
:     >> Pass_To_Assembler ( X ( X.all'First )'Address );

:     Wes> X.all'First and X'First should be identical.

:     Wes> X'Address and X(X'First)'Address should be identical, too,
:     Wes> unless ...

: Is this true if you deal with unconstrained arrays ? The bounds have
: to be stored at the beginning of the array. I think that X'Address
: would give you the address of the location where the bounds are stored.

In Ada 95, the 'Address of an array is supposed to point at
the first component, independent of where the bounds are stored.
See RM95-13.3(14).

In Ada 83, it was not specified, and compilers differed
in their interpretation of 'Address on an array.
You are certainly safe using X(X'First)'Address.

On the other hand, if X is a pointer, X'Address and X.all'Address
are definitely *not* the same thing.  X'Address is the address
of the pointer, X.all'Address is the address of (the first component of)
the pointed-to object.

:  -hannes

-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Cambridge, MA  USA




  parent 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 ` Hannes Haug
1996-06-25  0:00   ` Robert A Duff
1996-06-25  0:00   ` Tucker Taft [this message]
     [not found]     ` <Dtzv4J.9FL@thomsoft.com>
1996-07-17  0:00       ` Robert Dewar
1996-06-25  0:00 ` Jon S Anthony
1996-06-26  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   ` Robert Dewar
1996-06-20  0:00 ` Hannes Haug
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