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.5 required=5.0 tests=BAYES_00,STOX_REPLY_TYPE autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,39c061fa6e3ec349 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!goblin1!goblin.stu.neva.ru!news.astraweb.com!border5.a.newsrouter.astraweb.com!feed.xsnews.nl!border-3.ams.xsnews.nl!upload-2.xsnews.nl!10.10.69.6.MISMATCH!frontend-F09-06.ams.news.kpn.nl From: "ldries46" Newsgroups: comp.lang.ada References: <4e2c416b$0$2574$703f8584@news.kpn.nl> <4e2d13bc$0$2576$703f8584@news.kpn.nl> In-Reply-To: Subject: Re: acceess problem Date: Mon, 25 Jul 2011 11:59:31 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 15.4.3508.1109 X-MimeOLE: Produced By Microsoft MimeOLE V15.4.3508.1109 Message-ID: <4e2d3e9e$0$2559$703f8584@news.kpn.nl> Organization: KPN.com NNTP-Posting-Host: 77.168.179.107 X-Trace: 1311587998 news.kpn.nl 2559 77.168.179.107@kpn/77.168.179.107:49354 Xref: g2news1.google.com comp.lang.ada:20343 Date: 2011-07-25T11:59:31+02:00 List-Id: Thanks this was the solution to get the compiler accepting the construction. L. Dries "Simon Wright" schreef in bericht news:m24o2azrwb.fsf@pushface.org... "ldries46" writes: > I have done what you suggested and got the following error message on > the line > Axis1Amb : array (0 .. 3) of aliased GLfloat := (AxL, 0.0, 0.0, 1.0); > > non-local pointer cannot point to local object I should have tried it, sorry. Replace 'Access with 'Unchecked_Access or, if that doesn't work, with the (GNAT-special) 'Unrestricted_Access. Later: I did try it, with these two: package Floats is type P is access all Float; end Floats; with Floats; package Aliased_Stuff is A : array (0 .. 3) of aliased Float := (42.0, 0.0, 0.0, 1.0); P : Floats.P := A (0)'Access; end Aliased_Stuff; and the compiler (GNAT GPL 2011) was quite happy.