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,XPRIO autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!newsfeed.fsmpi.rwth-aachen.de!reality.xs3.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Request for help from the ARG: Static constants Date: Mon, 3 Mar 2014 18:03:56 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1393891436 26087 69.95.181.76 (4 Mar 2014 00:03:56 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 4 Mar 2014 00:03:56 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-RFC2646: Format=Flowed; Original Xref: news.eternal-september.org comp.lang.ada:18772 Date: 2014-03-03T18:03:56-06:00 List-Id: There is a language-lawyer level question that some of the ARG members have been discussing privately for far too long in the past week. An important part of the question is the compatibility effect of changing the rules to match the expectation. As such, I'd like to find out what various compilers do on the following test program. I've tried recent versions of GNAT and Janus/Ada, both of which reject the program citing an error at (2). [This is not supported by the RM wording, BTW.] If you have access to some other Ada compiler, please attempt to compile this program and report the result, either here or to me privately (randy@rrsoftware.com). Randy Brukardt, ARG Editor. --- Cut here --- with Ada.Text_IO; procedure SC is Item_Size : constant := 0; begin Ada.Text_IO.Put_Line ("Start Static Constant check"); if Item_Size > 0 then declare Length : Positive := Item_Size; -- (1) type Data_Index is range 1 .. Length; -- (2) type Data_Array is array (Data_Index) of Natural; begin Ada.Text_IO.Put_Line ("Can't get here"); exception when Constraint_Error => Ada.Text_IO.Put_Line ("Can't get here, either"); end; else -- Do nothing Ada.Text_IO.Put_Line ("Nothing as expected"); end if; Ada.Text_IO.Put_Line ("End Static Constant check."); end SC;