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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b82917c628cc6fdf X-Google-Attributes: gid103376,public From: dennison@telepath.com Subject: Re: Ada 83 Pointers question Date: 1999/01/21 Message-ID: <787dam$hva$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 435207223 References: <36A658CA.97438B6@cacd.rockwell.com> X-Http-Proxy: 1.0 x15.dejanews.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Thu Jan 21 14:24:33 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.5 [en] (WinNT; I) Date: 1999-01-21T00:00:00+00:00 List-Id: 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