comp.lang.ada
 help / color / mirror / Atom feed
From: "Gerd" <GerdM.O@t-online.de>
Subject: Enumeration type - GNAT 3.15p bug?
Date: 17 Aug 2006 04:49:55 -0700
Date: 2006-08-17T04:49:55-07:00	[thread overview]
Message-ID: <1155815395.237631.224930@m79g2000cwm.googlegroups.com> (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;




             reply	other threads:[~2006-08-17 11:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-17 11:49 Gerd [this message]
2006-08-17 12:03 ` Enumeration type - GNAT 3.15p bug? 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
replies disabled

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