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,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1ea19776e3073a96 X-Google-Attributes: gid103376,public From: Geoff Bull Subject: Re: C/C++ programmer giving Ada95 a chance -- writing an emulator. Date: 2000/04/02 Message-ID: <38E69A86.B1DC7C0A@acenet.com.au>#1/1 X-Deja-AN: 605474262 Content-Transfer-Encoding: 7bit References: <38E3DBD7.27F5B246@acenet.com.au> <2YSE4.251$sy6.25957@news.pacbell.net> <38E44CC7.4206E027@acenet.com.au> <38E621C2.87B64ED9@averstar.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@telstra.net X-Trace: nsw.nnrp.telstra.net 954637703 203.35.118.1 (Sun, 02 Apr 2000 11:08:23 EST) Organization: Customer of Telstra Big Pond Direct MIME-Version: 1.0 NNTP-Posting-Date: Sun, 02 Apr 2000 11:08:23 EST Newsgroups: comp.lang.ada Date: 2000-04-02T00:00:00+00:00 List-Id: Tucker Taft wrote: > > Geoff Bull wrote: > > > > If I Initialise the array like so: > > > > Op_Table : array (Opcode) of Op_Root > > := (0 => Op_Root (O0), > > others => OU); > > > > then make the assignments: > > Op_Table (1) := Op_Root (O1); > > Op_Table (2) := Op_Root (O2); > > Op_Table (3) := Op_Root (O3); > > > > > > What is going on here? > > It look like the assigments throw away the tag (like Cohen > > says it should) but the initializer keeps the tag. > > That would be a bug. The tag is *not* determined by the initial > value if the target type is "specific" (as opposed to classwide). > > Definitely a bug. It looks like GNAT is copying the tag from the initial value, I worked out exactly what is happening. The bug is in aggregate assignments to an array or a record of tagged components. I.e. I can later change the tags in Op_table by making an aggregate assignment to it. Also, if I don't initialise Op_table, it seems the tags in it are not initialised either. This seems wrong to me too, but I am just guessing in this case. Geoff