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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.dca.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!feeds.news.ox.ac.uk!news.ox.ac.uk!nntp-feed.chiark.greenend.org.uk!ewrotcd!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: Re: Request for help from the ARG: Static constants Date: Mon, 3 Mar 2014 19:22:42 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1393896163 23437 69.95.181.76 (4 Mar 2014 01:22:43 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 4 Mar 2014 01:22:43 +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; Response Xref: number.nntp.dca.giganews.com comp.lang.ada:185123 Date: 2014-03-03T19:22:42-06:00 List-Id: Tucker Taft has pointed out that I left out the keyword "constant" from my test program, which makes a big difference! Please try the corrected program below: > 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 : constant 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;