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 Path: g2news2.google.com!postnews.google.com!c9g2000yqm.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Issue with GNAT GPL 2009 and GtkAda Date: Mon, 29 Jun 2009 17:48:51 -0700 (PDT) Organization: http://groups.google.com Message-ID: <32142871-1a4e-4c8f-923e-bb45833d5af5@c9g2000yqm.googlegroups.com> References: <4A414EBB.8060204@free.fr> <1avd65rn49abv$.krcxo2gdzb16$.dlg@40tude.net> <4a43c9ce$0$420$426a74cc@news.free.fr> <4a4537a3$0$441$426a34cc@news.free.fr> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1246322931 1541 127.0.0.1 (30 Jun 2009 00:48:51 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 30 Jun 2009 00:48:51 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: c9g2000yqm.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:6745 Date: 2009-06-29T17:48:51-07:00 List-Id: On Jun 26, 2:03=A0pm, Damien Carbonne 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 :=3D 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