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,d6c75b0f89a0f085 X-Google-Attributes: gid103376,public From: dennison@telepath.com Subject: Re: What's wrong with this code? Date: 1999/04/21 Message-ID: <7fkpe7$5is$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 469118103 References: <7fi85m$sb3$1@nnrp1.dejanews.com> <7fiegr$43q$1@nnrp1.dejanews.com> <7fig4m$5f5$1@nnrp1.dejanews.com> X-Http-Proxy: 1.0 x14.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: Wed Apr 21 15:04:43 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.5 [en] (WinNT; I) Date: 1999-04-21T00:00:00+00:00 List-Id: In article , Matthew Heaney wrote: > dennison@telepath.com writes: > > > I tried adding the following declarations: > > type Alarm_List is array (1..2) of Alarm_P; > > > > type Alarm is tagged limited > > ... > > Al : Alarm_List := (others => Alarm'Access); > > > > And got this error (on the "Al" field) instead: > > alarm_model.ads:52:43: non-local pointer cannot point to local object > > What message do you get if you use 'Unchecked_Access instead of 'Access? Just the same old ""Access" attribute cann be applied to type". Good call. I tried compiling the same code (the original code, not my modified version) using my GreenHills (Intermetrics-based) compiler, and got: d:\test\tmp\alarm_model.ads: Error: line 53 col 26 LRM:3.10.2(28), The accessibility level of the prefix to 'ACCESS shall not be statically deeper than that of the expected type of the allocator, Continuing on the same line I got the above Gnat error. Changing the three "'Access"es to "'Unchecked_Access" caused the GrennHills compile to succeed. But in Gnat the same code gave me alarm_model.ads:53:43: "Unchecked_Access" attribute cannot be applied to type alarm_model.ads:54:41: "Unchecked_Access" attribute cannot be applied to type alarm_model.ads:55:49: "Unchecked_Access" attribute cannot be applied to type So it looks like one compiler (gnat) thinks the whole construct is illegal, while the other (GreenHills) thinks the only problem is accessability levels. -- T.E.D. -----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own