comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Carter <jrcarter@acm.org>
Subject: Re: Exchanging objects between programs with different inheritance hierarchies
Date: Wed, 13 Nov 2002 17:59:26 GMT
Date: 2002-11-13T17:59:26+00:00	[thread overview]
Message-ID: <3DD29333.5070600@acm.org> (raw)
In-Reply-To: mailman.1037153942.12692.comp.lang.ada@ada.eu.org

Steven Deller wrote:
> Ada experts,
> We are in the process of trying to convert some code to GNAT that worked
> on another Ada compiler.   The code transmits tagged type objects
> between processes, and uses unchecked conversion at the receiving end to
> convert to the destination object type.  The objects are various types
> derived from a "base" object with identical inheritance "path", but not
> identical inheritance hierarchies.  
> 
> Using unchecked_conversion depends on the tags being integral to the
> record structures.  On GNAT they are not, so the code fails.
> 
> The code is clearly incorrect Ada.

Had the code used composition rather than type extension this problem 
would not have arisen.

-- 
Jeff Carter
"Mr. President, we must not allow a mine-shaft gap!"
Dr. Strangelove




  parent reply	other threads:[~2002-11-13 17:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3DC93287.2EA290F0@myob.com>
2002-11-13  2:19 ` Exchanging objects between programs with different inheritance hierarchies Steven Deller
2002-11-13  6:05   ` Jim Rogers
2002-11-13 15:54     ` Simon Wright
2002-11-13 17:44       ` tmoran
2002-11-14  6:29         ` Simon Wright
2002-11-13 17:59   ` Jeffrey Carter [this message]
2002-11-13 18:23     ` Robert A Duff
2002-11-13 23:17       ` Steven Deller
2002-11-13 12:18 Grein, Christoph
     [not found] <200211131218.NAA13957@bulgaria.otn.eurocopter.de>
2002-11-13 17:22 ` Steven Deller
2002-11-13 18:12   ` Robert A Duff
replies disabled

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