comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: acceess problem
Date: Mon, 25 Jul 2011 09:27:48 +0100
Date: 2011-07-25T09:27:48+01:00	[thread overview]
Message-ID: <m24o2azrwb.fsf@pushface.org> (raw)
In-Reply-To: 4e2d13bc$0$2576$703f8584@news.kpn.nl

"ldries46" <bertus.dries@planet.nl> 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.



  reply	other threads:[~2011-07-25  8:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-24 15:59 acceess problem ldries46
2011-07-24 17:27 ` Simon Wright
2011-07-25  6:57   ` ldries46
2011-07-25  8:27     ` Simon Wright [this message]
2011-07-25  9:59       ` ldries46
2011-07-26 15:57       ` Gautier write-only
2011-07-26 17:43         ` Adam Beneschan
2011-07-27 12:06           ` Gautier write-only
2011-07-25  9:08     ` AdaMagica
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox