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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,65b902127ca8a604 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news2.google.com!news.glorb.com!gegeweb.org!fdn.fr!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Issue with GNAT GPL 2009 and GtkAda Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <4A414EBB.8060204@free.fr> <1avd65rn49abv$.krcxo2gdzb16$.dlg@40tude.net> <4a43c9ce$0$420$426a74cc@news.free.fr> <4a44ae4e$0$6295$4f793bc4@news.tdc.fi> <4a44f758$0$1538$426a74cc@news.free.fr> Date: Fri, 26 Jun 2009 19:28:25 +0200 Message-ID: <3d07k0r3scol$.l2mvcomfxk1c$.dlg@40tude.net> NNTP-Posting-Date: 26 Jun 2009 19:28:19 CEST NNTP-Posting-Host: 2f48f617.newsspool4.arcor-online.net X-Trace: DXC=fPAkd<;SAKh:i=48;n?Z:`4IUK On Fri, 26 Jun 2009 18:29:11 +0200, Damien Carbonne wrote: > Niklas Holsti a �crit : >> > Damien Carbonne writes: >> >> >> >> type Listener is interface; >> >> procedure Process (L : in out Listener) is abstract; >> ... >> >> type Base is tagged null record; >> ... >> >> type Derived is new Base and Listener with null record; >> >> overriding procedure Process (D : in out Derived); >> >> Stephen Leake wrote: >>> The problem is clear here. >>> >>> "D : in out Derived" is allowed to create a copy of the actual >>> parameter. >> >> Huh? Do you mean that this "D" parameter may be passed by copy? But >> "Derived" is a tagged type, and tagged types are passed by reference, >> not by copy. Or so I thought. >> > I also thought that tagged types were always passed by reference, > whatever the mode (in, out, in out) is. Correct. > I'll have to read Ada RM ! > If this is true, it means that using in/out/in out modes is almost > impossible in the code I write if this code must be mixed with code from > third party libraries (like GtkAda) that use access almost everywhere. sad. No, GtkAda does not use controlled or tagged types when it talks to Gtk. Such types should not have C convention. Instead of that GtkAda associates a C type with each tagged Ada one, which serves as a proxy. The address of this C object can be obtained using the Get_Object call. You will often find it in the implementation of GtkAda subroutines. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de