comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Access to interface conversion problem
Date: Tue, 13 Mar 2007 12:06:07 -0400
Date: 2007-03-13T12:06:07-04:00	[thread overview]
Message-ID: <wccird5p1qo.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 1173799509.497206.119820@q40g2000cwq.googlegroups.com

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



  reply	other threads:[~2007-03-13 16:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-13 15:25 Access to interface conversion problem msimonides
2007-03-13 16:06 ` Robert A Duff [this message]
2007-03-13 16:54   ` Adam Beneschan
2007-03-13 17:35     ` Robert A Duff
2007-03-13 20:56 ` Simon Wright
2007-03-13 22:32   ` Adam Beneschan
2007-03-14  9:06     ` msimonides
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox