comp.lang.ada
 help / color / mirror / Atom feed
From: dennison@telepath.com
Subject: Re: Ada 83 Pointers question
Date: 1999/01/21
Date: 1999-01-21T00:00:00+00:00	[thread overview]
Message-ID: <787dam$hva$1@nnrp1.dejanews.com> (raw)
In-Reply-To: 36A658CA.97438B6@cacd.rockwell.com

In article <36A658CA.97438B6@cacd.rockwell.com>,
  aalowe@cacd.rockwell.com wrote:
> We are using a supped up 83 compiler originally DDC-I but maintained
...
> Now I am not completely comfortable with all of the aspects of this
> design, and there are many spots for the compiler to fail, but someone
> in our organization said that Ada 83 has a limitation that a pointer can
> not point to an item in a composite type.  This seems a bit broad.  If

Well, in Ada83 the only language-defined way to get a vaild pointer was to
use an allocator. Unchecked conversion from address to pointer types was not
gauranteed to work. It would be physically impossible to manage to allocate
yourself a pointer to a record field or array element (other than the first
one, of course). However in practice every vendor gave you a way to get such
pointers, usually through converting addresses to access types.

There is also the issue of placement. You can't just add 20 to the address of
an array of enums and expect that to give you elment 20 in the array. You
must first take steps to ensure that the enums are represented as bytes, and
the array is packed to the expected size. Likewise you have no clue what the
offset of a field in a record is from the start of the record unless you
specifiy it with a representation clause. But taking the 'address of the
field or element in question will typically get around this issue.

T.E.D.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




      parent reply	other threads:[~1999-01-21  0:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-20  0:00 Ada 83 Pointers question Lowe Anthony A
1999-01-21  0:00 ` Jeff Carter
1999-01-21  0:00   ` Matthew Heaney
1999-01-21  0:00 ` robert_dewar
1999-01-21  0:00   ` dennison
1999-01-21  0:00 ` dennison [this message]
replies disabled

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