comp.lang.ada
 help / color / mirror / Atom feed
From: Adam Beneschan <adam@irvine.com>
Subject: Re: Issue with GNAT GPL 2009 and GtkAda
Date: Mon, 29 Jun 2009 17:48:51 -0700 (PDT)
Date: 2009-06-29T17:48:51-07:00	[thread overview]
Message-ID: <32142871-1a4e-4c8f-923e-bb45833d5af5@c9g2000yqm.googlegroups.com> (raw)
In-Reply-To: 4a4537a3$0$441$426a34cc@news.free.fr

On Jun 26, 2:03 pm, Damien Carbonne <damien.carbo...@free.fr> wrote:
> If what you say is true, why does the following example work fine (using
> GNAT), without any compiler warning or execution error ?

Because you're not trying to store the 'Access anywhere.

The problem in your original example is with the line

   BB := B.all'Access;

where BB is a variable of type Base_Ref.  Since the type Base_Ref is
global (i.e. has library-level accessibility), since it's defined in a
library package, any value of type Base_Ref also has to be global (if
you never use 'Unchecked_Access).  It can't be the 'Access of a local
variable.  Otherwise, you could work things out (by assigning
something else to BB) so that you have a global variable of type
Base_Ref that points to a local variable that no longer exists.

But in the second example, when you take the 'Access of a parameter,
you never try to convert it to a global type.  You're converting it to
an "anonymous access parameter" type when, say, you call P1A
(X'Access...), but that's OK, since anonymous access parameters take
on the accessibility level of whatever you pass them.  (Very roughly
speaking.)

It has nothing to do with "aliased".  Stephe was a tad confused.
Omitting "aliased" can make a program illegal but I do not believe
there is any way that it can cause a Program_Error at runtime.

                            -- Adam



  parent reply	other threads:[~2009-06-30  0:48 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-23 21:52 Issue with GNAT GPL 2009 and GtkAda Damien Carbonne
2009-06-24  7:40 ` Dmitry A. Kazakov
2009-06-24 10:15 ` Stephen Leake
2009-06-25  9:06   ` Stephen Leake
2009-06-25  9:39     ` Dmitry A. Kazakov
2009-06-25 19:02       ` Damien Carbonne
2009-06-26  9:31         ` Stephen Leake
2009-06-26 11:18           ` Niklas Holsti
2009-06-26 16:29             ` Damien Carbonne
2009-06-26 17:28               ` Dmitry A. Kazakov
2009-06-26 19:27                 ` Damien Carbonne
2009-06-26 19:50                   ` Dmitry A. Kazakov
2009-06-26 21:51             ` Randy Brukardt
2009-06-27 11:11               ` Stephen Leake
2009-06-27 17:04                 ` Robert A Duff
2009-06-30 11:11                   ` Stephen Leake
2009-06-30 18:10                     ` Robert A Duff
2009-06-29 22:11                 ` Randy Brukardt
2009-06-30 11:13                   ` Stephen Leake
2009-06-30 15:26                     ` Adam Beneschan
2009-06-30 15:59               ` Adam Beneschan
2009-06-30 23:11                 ` Randy Brukardt
2009-06-27  9:56             ` Stephen Leake
2009-06-26 21:03           ` Damien Carbonne
2009-06-27 11:21             ` Stephen Leake
2009-06-27 12:25               ` Damien Carbonne
2009-06-27 12:35                 ` Damien Carbonne
2009-06-29 22:15                   ` Randy Brukardt
2009-07-01 19:22                     ` Damien Carbonne
2009-06-30  0:48             ` Adam Beneschan [this message]
2009-06-30 11:18               ` Stephen Leake
2009-06-25 20:49       ` Randy Brukardt
2009-06-26  7:20         ` Dmitry A. Kazakov
2009-06-26  8:17           ` Georg Bauhaus
2009-06-26  8:52             ` Dmitry A. Kazakov
2009-06-26 21:38               ` Randy Brukardt
2009-06-27  7:47                 ` Dmitry A. Kazakov
2009-06-29 21:59                   ` Randy Brukardt
2009-06-30  8:31                     ` Dmitry A. Kazakov
2009-06-26 21:31           ` Randy Brukardt
2009-06-27  7:53             ` Dmitry A. Kazakov
2009-06-26  8:39       ` Alex R. Mosteo
2009-06-26  9:07         ` Dmitry A. Kazakov
2009-06-27  9:53           ` Stephen Leake
2009-06-26 21:40         ` Randy Brukardt
2009-06-29 10:04           ` Alex R. Mosteo
2009-06-26  9:02       ` Stephen Leake
2009-06-26  9:14         ` Dmitry A. Kazakov
replies disabled

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