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 09:46:43 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!newshosting.com!news-xfer1.atl.newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.tpinternet.pl!atlantis.news.tpi.pl!news.tpi.pl!not-for-mail From: "Michal Morawski" Newsgroups: comp.lang.ada Subject: Re: [announcement] SYSAPI and SYSSVC for Windows Date: Sun, 21 Dec 2003 18:46:00 +0100 Organization: tp.internet - http://www.tpi.pl/ Message-ID: References: NNTP-Posting-Host: pd119.lodz.cvx.ppp.tpnet.pl X-Trace: atlantis.news.tpi.pl 1072028807 25852 213.77.230.119 (21 Dec 2003 17:46:47 GMT) X-Complaints-To: usenet@tpi.pl NNTP-Posting-Date: Sun, 21 Dec 2003 17:46:47 +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 Xref: archiver1.google.com comp.lang.ada:3671 Date: 2003-12-21T18:46:00+01:00 List-Id: Try: O.B := O.A(1)'Unchecked_Access; -- This is OK, A(i) are aliased 'Access does not work because in the procedure You are getting address of the variable (may be) on the stack Michal Morawski "Ekkehard Morgenstern" wrote in message news:bs4fbr$g8f$1@online.de... > > "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? >