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,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,bfa3bd0e1081a777,start X-Google-Attributes: gid103376,public From: "Vladimir Olensky" Subject: OA bug ? Date: 1999/06/21 Message-ID: <929984465.815.34@news.remarQ.com>#1/1 X-Deja-AN: 492161385 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 X-Complaints-To: newsabuse@remarQ.com X-Trace: 929984465.815.34 K3TLTKYJOA5C9C7F8C qube-02.us-ca.remarq.com Organization: Posted via RemarQ, http://www.remarQ.com - The Internet's Discussion Network NNTP-Posting-Date: Mon, 21 Jun 1999 17:01:05 GMT Newsgroups: comp.lang.ada Date: 1999-06-21T00:00:00+00:00 List-Id: Here is small piece of code to illustrate the problem : ================================= with Ada.Finalization; package T_Ctld is type T is new Ada.Finalization.Controlled with private; type T_A is access all T; type T_CA is access all T'Class; private type T is new Ada.Finalization.Controlled with null record; end T_Ctld; ------------------------ with T_Ctld; Use T_Ctld; procedure Tst_Ctld_bug is Ptr1: T_CA; begin null; end Tst_Ctld_bug; ---------------------------- OA compiles everything with no problem. At a link time it gives an error: t_ctld.obj : error LNK2005: t_ctld.t__acc_cleanup already defined in t_ctld.obj tst_ctld_bug.exe : fatal error LNK1169: one or more multiply defined symbols found ------------------------- Examination of T_Ctld assembler listing gives the following: ;Listing of uninitialized data section ; ; ; 000000 t_ctld.t__acc_cleanup DB 32 DUP(?) ; 000020 t_ctld.t__acc_cleanup DB 32 DUP(?) ; and this explains the above problem ----- 000000 corresponds to T_CA; 000020 corresponds to T_A; ============================== Changing T_ctld fixes the problem: with Ada.Finalization; package T_Ctld is type T is new Ada.Finalization.Controlled with null record; type T_A is access all T; type T_CA is access all T'Class; end T_Ctld; ----------------------------- the same piece of assembler listing: ;Listing of uninitialized data section ; ; ; 000000 t_ctld.t_ca__acc_cleanup DB 32 DUP(?) ; 000020 t_ctld.t_a__acc_cleanup DB 32 DUP(?) ; Here everything is OK and as a result there are no problems building Tst_Ctld_bug. ========================================= So it looks as OA special edition has some problems with internal data representation for controlled types with private part. With GNAT everything is OK. Any comments ? Regards. Vladimir Olensky