From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.6 required=5.0 tests=BAYES_05,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b82917c628cc6fdf,start X-Google-Attributes: gid103376,public From: Lowe Anthony A Subject: Ada 83 Pointers question Date: 1999/01/20 Message-ID: <36A658CA.97438B6@cacd.rockwell.com>#1/1 X-Deja-AN: 434999742 Content-Transfer-Encoding: 7bit X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Rockwell A&C Mime-Version: 1.0 Reply-To: aalowe@cacd.rockwell.com Newsgroups: comp.lang.ada Date: 1999-01-20T00:00:00+00:00 List-Id: 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