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-Thread: 103376,3e5147bcbe0e25dc X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Access to interface conversion problem Date: Tue, 13 Mar 2007 12:06:07 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <1173799509.497206.119820@q40g2000cwq.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1173801967 30867 192.74.137.71 (13 Mar 2007 16:06:07 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 13 Mar 2007 16:06:07 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:cGN7LXx01J+XNfCmzzTNsDmTjRw= Xref: g2news1.google.com comp.lang.ada:14514 Date: 2007-03-13T12:06:07-04:00 List-Id: msimonides@power.com.pl writes: > The output of this program is two addresses, the first one 4 less than > the second one (in my original program the difference is 12). > Removing the Root_Implementation_Type tagged type from inheritance > hierarchy results in identical addresses. > > The question is: > Am I doing something wrong with the conversion? I don't know (I didn't read your code carefully), but it is normal for access values pointing at the same object to be represented by different addresses, depending on which interface you are viewing the object as. This is because C++ works that way, and GNAT mimics the C++ conventions in order to make interfacing Ada with C++ easier. C++ has a more powerful form of multiple inheritance than Ada does. If we didn't care about interfacing, we could implement Ada without this somewhat-strange offsetting of the addresses. > To me this looks like a compiler bug. Could be. - Bob