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.3 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, REPLYTO_WITHOUT_TO_CC autolearn=no 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 15:16:03 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.vmunix.org!fr.clara.net!heighliner.fr.clara.net!freenix!enst.fr!not-for-mail From: "Steven Deller" Newsgroups: comp.lang.ada Subject: RE: Exchanging objects between programs with different inheritance hierarchies Date: Wed, 13 Nov 2002 17:17:43 -0600 Organization: Smooth Sailing LLC Sender: comp.lang.ada-admin@ada.eu.org Message-ID: Reply-To: comp.lang.ada@ada.eu.org NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: avanie.enst.fr 1037229363 8762 137.194.161.2 (13 Nov 2002 23:16:02 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Wed, 13 Nov 2002 23:16:02 +0000 (UTC) Return-Path: X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 In-reply-to: X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300 Importance: Normal Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.0.13 Precedence: bulk X-Reply-To: List-Unsubscribe: , List-Id: comp.lang.ada mail<->news gateway List-Post: List-Help: List-Subscribe: , Errors-To: comp.lang.ada-admin@ada.eu.org X-BeenThere: comp.lang.ada@ada.eu.org Xref: archiver1.google.com comp.lang.ada:30841 Date: 2002-11-13T17:17:43-06:00 > > Steven Deller wrote: > >... Using unchecked_conversion depends > > > on the tags being integral to the > > > record structures. On GNAT they are not, so the code fails. > > Is this really true? I thought all Ada compilers store the > tag field as a field in the record (although not always at > the same offset)? What is GNAT doing that messes up your > unchecked conversions? > > Maybe I'm missing your point. > > - Bob I looked at the generated code. For the tag comparison it was generating 3 dereferences for an access type and 2 dereferences for an object. It appears the single tag word in the record is actually a pointer to structure with a pointer to the actual value. In different programs, those pointers are to different locations, so just uchecked converting to the unchecked, saved 32-bit value in the original record does not work. For Apex, the tag comparison was a simple value comparison and, since it seemed to work across programs, apparently that value is not a pointer. Regards, Steve