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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8332ddd3efd0a65,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!m79g2000cwm.googlegroups.com!not-for-mail From: "Gerd" Newsgroups: comp.lang.ada Subject: Enumeration type - GNAT 3.15p bug? Date: 17 Aug 2006 04:49:55 -0700 Organization: http://groups.google.com Message-ID: <1155815395.237631.224930@m79g2000cwm.googlegroups.com> NNTP-Posting-Host: 62.159.113.204 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1155815400 19758 127.0.0.1 (17 Aug 2006 11:50:00 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 17 Aug 2006 11:50:00 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: m79g2000cwm.googlegroups.com; posting-host=62.159.113.204; posting-account=_FaVAg0AAAAYUPoPAQYNRFF35JBHf9i7 Xref: g2news2.google.com comp.lang.ada:6240 Date: 2006-08-17T04:49:55-07:00 List-Id: 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;