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-7-bit X-Google-Thread: 103376,e64088334cf5790e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-13 10:00:24 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn13feed!worldnet.att.net!207.217.77.102!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3DD29333.5070600@acm.org> From: Jeffrey Carter User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Exchanging objects between programs with different inheritance hierarchies References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 13 Nov 2002 17:59:26 GMT NNTP-Posting-Host: 63.184.1.96 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 1037210366 63.184.1.96 (Wed, 13 Nov 2002 09:59:26 PST) NNTP-Posting-Date: Wed, 13 Nov 2002 09:59:26 PST Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: archiver1.google.com comp.lang.ada:30822 Date: 2002-11-13T17:59:26+00:00 List-Id: 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