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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8332ddd3efd0a65 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Enumeration type - GNAT 3.15p bug? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1155815395.237631.224930@m79g2000cwm.googlegroups.com> Date: Thu, 17 Aug 2006 14:46:20 +0200 Message-ID: <1bvb9cpaso1n7$.5s3km0we2k6f.dlg@40tude.net> NNTP-Posting-Date: 17 Aug 2006 14:46:20 CEST NNTP-Posting-Host: d93e1e90.newsspool1.arcor-online.net X-Trace: DXC=:D0fg3n\>J;T2Rfi64Fo<]lROoR18kF7enW;^6ZC`4F0oL 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