comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Enumeration type - GNAT 3.15p bug?
Date: Thu, 17 Aug 2006 14:46:20 +0200
Date: 2006-08-17T14:46:20+02:00	[thread overview]
Message-ID: <1bvb9cpaso1n7$.5s3km0we2k6f.dlg@40tude.net> (raw)
In-Reply-To: 1155815395.237631.224930@m79g2000cwm.googlegroups.com

On 17 Aug 2006 04:49:55 -0700, Gerd wrote:

> 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;

GNAT 3.15p (Windows):

   raised CONSTRAINT_ERROR : jenumxa.adb:8 overflow check failed

Is it possible that you have suppressed checks?

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  parent reply	other threads:[~2006-08-17 12:46 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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