From: "Ken Garlington" <Ken.Garlington@computer.org>
Subject: Re: Array access via pointer?
Date: 2000/08/04
Date: 2000-08-04T00:00:00+00:00 [thread overview]
Message-ID: <hnqi5.2613$SB4.239864@news.flash.net> (raw)
In-Reply-To: 398A1B77.A2A3D302@earthlink.net
"Robert I. Eachus" <rieachus@earthlink.net> wrote in message
news:398A1B77.A2A3D302@earthlink.net...
> Ken Garlington wrote:
>
> > No, you don't have to allocate the arrays in the heap -- so long as
you're
> > willing to accept the risks of converting a System.Address to an access
> > type! (For the specific example I gave, the risks appear to be low in my
> > experience.)
>
> And my experience has been quite the opposite! If your only use of
> the 'trick' is to convert the address of an object to an access value
> designating the object, it will usually work. In general in Ada 95 the
> address of an array object should be the address of the first element:
>
> "For an array X, X'Address should point at the first component of the
> array,
> and not at the array bounds." RM 13.3(14)
Look at the code I posted. It doesn't take the address of an array.
> The right solution, at least to the interfacing problems is to use
> Annex B.
Unfortunately, the problem is constrained to Ada83, so that's not much help.
The solution *as posted* works on a variety of compilers.
next prev parent reply other threads:[~2000-08-04 0:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-08-01 0:00 Array access via pointer? Michael Carman
2000-08-01 0:00 ` Ted Dennison
2000-08-02 0:00 ` Michael Carman
2000-08-03 0:00 ` Ken Garlington
2000-08-03 0:00 ` Robert A Duff
2000-08-03 0:00 ` Ken Garlington
2000-08-04 0:00 ` Robert I. Eachus
2000-08-04 0:00 ` Ken Garlington [this message]
2000-08-02 0:00 ` Markku Kotiaho
2000-08-02 0:00 ` tmoran
2000-08-02 0:00 ` Michael Carman
2000-08-02 0:00 ` tmoran
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox