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!news1.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail 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> From: Stephen Leake Date: Sat, 27 Jun 2009 07:21:59 -0400 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (windows-nt) Cancel-Lock: sha1:UkyYLoowwUYzDwcN/k3UJYWDSl4= MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 509f54a4600dce9cadf9d26739 Xref: g2news2.google.com comp.lang.ada:6662 Date: 2009-06-27T07:21:59-04:00 List-Id: Damien Carbonne writes: > Stephen Leake a �crit : >> The problem is clear here. >> >> "D : in out Derived" is allowed to create a copy of the actual >> parameter. Thus the 'Access in Foreach could be on a stack copy of D, >> which will disappear eventually, leaving a dangling pointer in BB. So >> the accessibility error is correct. >> >> ... > > 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. > As I told in a previous message, I don't want to change the "in out" > mode of Interface (representing the code I wrote and that is > independant of GtkAda or any graphical toolkit), because one day it > could be used in cunjunction with third party code that uses access > ! Otherwise, it would almost certainly mean that one needs to use > access almost everywhere, even if it is meaningless. It's not meaningless. It tells the user that the body needs an access value. Hmm. I guess you mean "If I use a backend (other than GtkAda) that doesn't require access values, the use of 'access' in my frontend would be meaningless". Yes, that's true. Or at least, it only tells the user "if you switch to some other backend, that might need an access value". It's the price you pay for supporting multiple backends; you must support the worst feature of the entire set :). -- -- Stephe