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-Thread: a07f3367d7,39c061fa6e3ec349 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.glorb.com!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: acceess problem Date: Mon, 25 Jul 2011 09:27:48 +0100 Organization: A noiseless patient Spider Message-ID: References: <4e2c416b$0$2574$703f8584@news.kpn.nl> <4e2d13bc$0$2576$703f8584@news.kpn.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx04.eternal-september.org; posting-host="dFCm8HWntFqmDIilBLqEJQ"; logging-data="29245"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18FRX0ATG8pDzWHoHs/T22733fVaObX/A0=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (darwin) Cancel-Lock: sha1:/DDMZkrgahN7esfagJw5nWA5D0E= sha1:54thNaHLT1uRlGPwhuB14NcLBuU= Xref: g2news1.google.com comp.lang.ada:20341 Date: 2011-07-25T09:27:48+01:00 List-Id: "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.