comp.lang.ada
 help / color / mirror / Atom feed
* Ada 83 Pointers question
@ 1999-01-20  0:00 Lowe Anthony A
  1999-01-21  0:00 ` Jeff Carter
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Lowe Anthony A @ 1999-01-20  0:00 UTC (permalink / raw)


We are using a supped up 83 compiler originally DDC-I but maintained
internally with several cool Ada 95 features added on.  To this point we
have been testing on NT using ObjectAda (95 not 83), but we just moved
to the 83 compiler and a data structure which was working fine, no
longer even elaborates.

The basic idea is we have a series of data (an array) which holds a
bunch of information (a record) which contains a boolean (among other
items).   This is great for large data storage, but we need a 'snapshot'
of this data which is created using an array of another record which has
a boolean pointer into the original array.  This 'snapshot' is a
constant instance of an unconstrained array type.

Now since we are safety critical, we have been forbidden from using a
new clause and since the 'Access does not exist yet, the engineer
created a unchecked conversion to go between a System.Address and a
boolean pointer.   Thus when the 'snapshot' is created, it then
references the boolean pointer element to the array of the record to the
'Address of the boolean component.  Whew!

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
the answer is 'you can not trust the unchecked conversion to a pointer'
or 'you can not trust the compiler to represent the data the same way
every time for the 'Address to be valid' or 'maybe the compiler can not
handle the unconstrained array' or a dozen others I am hoping to hear
than fine.  I just want to make sure though that we are not fighting
against a true language limitation/bug which we can not solve.

Any suggestions/ background / input / hints / comments / pondering /
posturing / opinions are welcome but please don't lambaste the approach
too much.  We have some pretty severe limitations and it is a young guy
with large dreams and grand notions.  Thanks in advance!

--
Tony Lowe                   Rockwell Collins
1431 Opus Place   -  Downers Grove, IL 60515
(630)-960-8603          Fax : (630)-960-8207






^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1999-01-21  0:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox