comp.lang.ada
 help / color / mirror / Atom feed
* Request for help from the ARG: Static constants
@ 2014-03-04  0:03 Randy Brukardt
  2014-03-04  1:22 ` Randy Brukardt
  0 siblings, 1 reply; 3+ messages in thread
From: Randy Brukardt @ 2014-03-04  0:03 UTC (permalink / raw)


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;


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-03-04  2:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-04  0:03 Request for help from the ARG: Static constants Randy Brukardt
2014-03-04  1:22 ` Randy Brukardt
2014-03-04  2:59   ` tmoran

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox