comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <sb463ba@l1-hrz.uni-duisburg.de>
Subject: Re: address/access/pointer confusion
Date: Wed, 20 Oct 2004 23:37:41 +0000 (UTC)
Date: 2004-10-20T23:37:41+00:00	[thread overview]
Message-ID: <cl6ss5$hrf$1@a1-hrz.uni-duisburg.de> (raw)
In-Reply-To: 35f054ea.0410201051.78cc61a0@posting.google.com

skidmarks <aschwarz@acm.org> wrote:


:               p1 : System.Address := a(0)'Address;
not necessarily, I think.

And you also need to declare that a's components may be aliased,
using the same keyword "aliased" as you did for a, for the Integers in a.

When you compare C pointers to Ada arrays, the set
of attributes and array operations is largly missing in C.
(They are available in Ada, even for identifiers indirectly
denoting an array, as you have indicated.)

  a'range

for example.


:               -- p /= p1 in general
:               -- One representation of 'a' could be:
:               -- a  => <<size of a><pointer to space for a>> --> a(0)
:               -- p  => points to the 'a' dope vector (above)

AFAIK, dope info cannot always be assumed to be near addressing cells.
I think the GNAT docs, for example, speak about this in the
section on string access, using either fat or thin pointers.


-- Georg



  reply	other threads:[~2004-10-20 23:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-20 13:56 address/access/pointer confusion Hans Van den Eynden
2004-10-20 16:55 ` Martin Krischik
2004-10-20 18:51 ` skidmarks
2004-10-20 23:37   ` Georg Bauhaus [this message]
2004-10-21  7:30   ` Jacob Sparre Andersen
2004-10-22  1:14     ` Jeffrey Carter
replies disabled

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