From: Tucker Taft <stt@averstar.com>
Subject: Re: C/C++ programmer giving Ada95 a chance -- writing an emulator.
Date: 2000/04/01
Date: 2000-04-01T16:17:59+00:00 [thread overview]
Message-ID: <38E621C2.87B64ED9@averstar.com> (raw)
In-Reply-To: 38E44CC7.4206E027@acenet.com.au
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);
>
> I get the output:
>
> opcode 00
> undefined opcode
> undefined opcode
> undefined opcode
> undefined opcode
>
> 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).
The tag *is* determined by the initial value if the target type is classwide.
> Indeed the RM says in section 3.9 (22):
> "The tag of an object of a class-wide tagged type is that of its
> initialization expression. "
> The trouble is Op_Table components are not of a class wide type.
>
> Instead section 3.9 (20) applies:
> "The tag of a stand-alone object, a component, or an aggregate of a
> specific tagged type T identifies T"
>
> > I think we have here both an error in Gnat and an error in
> > Cohen's book!
>
> Unless somebody can show me where the RM says otherwise, I agree.
> I guess I'd better report this.
Definitely a bug. It looks like GNAT is copying the tag from the initial value,
which it shouldn't do in this case.
>
> Thanks for the enlightenment.
> Cheers
> Geoff
-Tucker Taft stt@averstar.com
next prev parent reply other threads:[~2000-04-01 0:00 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <38E3DBD7.27F5B246@acenet.com.au>
2000-03-31 0:00 ` C/C++ programmer giving Ada95 a chance -- writing an emulator tmoran
2000-03-31 0:00 ` Geoff Bull
2000-04-01 0:00 ` Tucker Taft [this message]
2000-04-02 0:00 ` Robert Dewar
2000-04-02 0:00 ` Geoff Bull
2000-04-02 0:00 ` Geoff Bull
[not found] <38e148e2.5089627@news.shreve.net>
2000-03-28 0:00 ` Ken Garlington
2000-03-28 0:00 ` Geoff Bull
2000-03-28 0:00 ` Jean-Marc Bourguet
2000-03-28 0:00 ` Juergen Pfeifer
2000-03-28 0:00 ` Jim Rogers
2000-03-29 0:00 ` Ed Falis
2000-03-29 0:00 ` James S. Rogers
2000-03-29 0:00 ` Jean-Marc Bourguet
2000-03-29 0:00 ` Robert Dewar
2000-03-30 0:00 ` Geoff Bull
2000-03-30 0:00 ` tmoran
2000-04-01 0:00 ` Robert Dewar
[not found] ` <38e19656.17008608@news.shreve.net>
2000-03-29 0:00 ` Marc A. Criley
2000-03-29 0:00 ` David Starner
2000-03-29 0:00 ` Robert A Duff
2000-03-30 0:00 ` Geoff Bull
2000-04-01 0:00 ` Robert Dewar
2000-03-29 0:00 ` Robert Dewar
2000-03-29 0:00 ` Jean-Marc Bourguet
2000-03-29 0:00 ` Robert Dewar
2000-03-30 0:00 ` Jean-Marc Bourguet
2000-04-01 0:00 ` Robert Dewar
2000-03-29 0:00 ` Marin D. Condic
2000-03-29 0:00 ` Robert A Duff
2000-03-29 0:00 ` Marin D. Condic
2000-03-30 0:00 ` Geoff Bull
2000-04-01 0:00 ` Robert Dewar
2000-04-02 0:00 ` Geoff Bull
2000-04-02 0:00 ` swhalen
2000-04-02 0:00 ` Robert Dewar
2000-03-29 0:00 ` Marin D. Condic
2000-03-29 0:00 ` swhalen
2000-03-29 0:00 ` Robert Dewar
2000-03-30 0:00 ` swhalen
2000-03-30 0:00 ` Ken Garlington
2000-03-30 0:00 ` Samuel T. Harris
2000-04-01 0:00 ` Robert Dewar
2000-04-05 0:00 ` Robert A Duff
2000-03-30 0:00 ` Geoff Bull
[not found] ` <38e7e951.8384503@news.shreve.net>
2000-04-02 0:00 ` Jean-Pierre Rosen
2000-04-02 0:00 ` Robert Dewar
2000-04-03 0:00 ` Paul Graham
2000-04-06 0:00 ` Robert Dewar
2000-04-06 0:00 ` Larry Kilgallen
2000-04-06 0:00 ` Robert Dewar
2000-04-06 0:00 ` Gautier
2000-04-07 0:00 ` Robert Dewar
2000-04-07 0:00 ` Gautier
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox