comp.lang.ada
 help / color / mirror / Atom feed
* Enumeration type - GNAT 3.15p bug?
@ 2006-08-17 11:49 Gerd
  2006-08-17 12:03 ` Georg Bauhaus
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Gerd @ 2006-08-17 11:49 UTC (permalink / raw)


Dear all,

I've found some misbehaviour of enumeration types and runtime checking.
Assigning constant values is checked at compile time. For the dynamic
assignment below (line 8) I would expect that an exception is raised,
but nothing happens. I generated an assembly listing and looked at the
code - the runtime check code is generated, but it seems to have a bug
(wrong address calculation).

Does someone know more about it?
- Is there really a bug in GNAT 3.15p?
- Did I do some misinterpretation?

As far as I know the 3.15p was the last officially released version
from AdaCore, wasn't it?



 1: procedure JEnumXa is
 2:   type ex is (Rot, Gruen, Gelb);
 3:
 4:   x : ex;
 5:
 6:   procedure ABC ( i : Integer) is
 7:   begin
 8:     x := ex'VAL(i);
 9:   end ABC;
10: begin
11: null;
12:   x := Rot;
13:   x := Gruen;
14:   x := ex'SUCC (X);
15:   -- x := ex'VAL (99);  -- compiletime error
16:   ABC (99);
17: end JEnumXa;




^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2006-08-29  1:17 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-17 11:49 Enumeration type - GNAT 3.15p bug? Gerd
2006-08-17 12:03 ` Georg Bauhaus
2006-08-17 13:19   ` Gerd
2006-08-17 18:15     ` Jeffrey R. Carter
2006-08-17 12:46 ` Dmitry A. Kazakov
2006-08-17 13:42   ` Gerd
2006-08-17 18:11     ` Jeffrey R. Carter
2006-08-17 18:34 ` Gautier
2006-08-17 18:37 ` Gautier
2006-08-18  8:25   ` Gerd
2006-08-19  2:53     ` Gautier
2006-08-19 20:50       ` Gerd
2006-08-20  9:27         ` Gautier
2006-08-28 13:54           ` Gerd
2006-08-29  1:17             ` Gautier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox