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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8a402d78988bdf2b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-21 07:48:12 PST From: "Ekkehard Morgenstern" Newsgroups: comp.lang.ada Subject: Re: [announcement] SYSAPI and SYSSVC for Windows Date: Sun, 21 Dec 2003 16:48:02 +0100 Organization: 1&1 Internet AG Message-ID: References: NNTP-Posting-Host: p508c0089.dip0.t-ipconnect.de Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: online.de 1072021691 16655 80.140.0.137 (21 Dec 2003 15:48:11 GMT) X-Complaints-To: abuse@einsundeins.com NNTP-Posting-Date: Sun, 21 Dec 2003 15:48:11 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!newsfeed2.easynews.com!easynews.com!easynews!newsfeed.news2me.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!newsfeed.stueberl.de!feed.news.tiscali.de!news.belwue.de!news.uni-ulm.de!rz.uni-karlsruhe.de!feed.news.schlund.de!schlund.de!news.online.de!not-for-mail Xref: archiver1.google.com comp.lang.ada:3670 Date: 2003-12-21T16:48:02+01:00 List-Id: "Dmitry A. Kazakov" wrote: > type T is limited private; > private > type Integer_Array is array (Integer range <>) of aliased Integer; > type T is limited record > A : Integer_Array (1..3); > end record; > > procedure F (O : in out T ) is > begin > ... O.A(1)'Access; -- This is OK, A(i) are aliased > end; > > If the array elements be tagged, then you would need not write "aliased" in > the array declaration. try to compile it! GNAT spat out an error message for it: "non-local pointer cannot point to local object" Here's the source, Luke: 1: procedure ttest0 is 2: type Integer_Array is array (Integer range <>) of aliased Integer; 3: type Integer_Access is access all Integer; 4: type T is limited record 5: A : Integer_Array (1..3); 6: B : Integer_Access; 7: end record; 8: procedure F( O : in out T ) is 9: begin 10: O.B := O.A(1)'Access; -- This is OK, A(i) are aliased 11: end; 12: O1 : T; 13: begin 14: F( O1 ); 15: end ttest0; ttest0.adb:10:17: non-local pointer cannot point to local object gnatmake: "ttest0.adb" compilation error So, what's wrong with it?