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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news1.google.com!news.glorb.com!de-l.enfer-du-nord.net!usenet-fr.net!proxad.net!feeder1-2.proxad.net!cleanfeed3-b.proxad.net!nnrp15-2.free.fr!not-for-mail Date: Sat, 27 Jun 2009 14:25:58 +0200 From: Damien Carbonne User-Agent: Thunderbird 2.0.0.22 (X11/20090605) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Issue with GNAT GPL 2009 and GtkAda References: <4A414EBB.8060204@free.fr> <1avd65rn49abv$.krcxo2gdzb16$.dlg@40tude.net> <4a43c9ce$0$420$426a74cc@news.free.fr> <4a4537a3$0$441$426a34cc@news.free.fr> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Message-ID: <4a460fd7$0$10813$426a74cc@news.free.fr> Organization: Guest of ProXad - France NNTP-Posting-Date: 27 Jun 2009 14:25:59 MEST NNTP-Posting-Host: 82.247.219.63 X-Trace: 1246105559 news-3.free.fr 10813 82.247.219.63:53819 X-Complaints-To: abuse@proxad.net Xref: g2news2.google.com comp.lang.ada:6664 Date: 2009-06-27T14:25:59+02:00 List-Id: Stephen Leake a �crit : >>> >>> ... >> If what you say is true, why does the following example work fine >> (using GNAT), without any compiler warning or execution error ? > > Because the object being passed is explicitly labeled "aliased"; that > means 'Access is allowed. See my other post from today. > In the example, there is only one place where an object is explicitly declared and labeled "aliased" : in Main. In signatures of P[123]M, X is not aliased (only in, out or in out modes). There is no "aliased" key word in the bodies of corresponding procedures. e.g.: procedure P1M (X : in out Base; Max_Depth : Positive) is begin Ada.Text_IO.Put_Line (Indent (Max_Depth) & "P1M" & Positive'Image (Max_Depth)); if Max_Depth > 1 then P1A (X'Access, Max_Depth - 1); -- Here use of Access on a tyoe that is implicitely aliased X.P1A (Max_Depth - 1); end if; end P1M; Nowhere X is explicitely declared aliased. It is only an "in out" tagged parameter. It is however possible to use X'Access, in my mind because X is tagged (and so passed by reference). Do you mean that the fact that X is labeled "aliased" in Main is propagated everywhere it is used ? I would find this strange (and certainly needing a special support from compiler). I really don't see the difference with the initial problem, where all types are tagged types or interfaces.