comp.lang.ada
 help / color / mirror / Atom feed
* Constant array declarations are not causing a compilation error when not fully initialized.
@ 2001-08-23  9:03 Mark Doherty
  2001-08-28 23:43 ` Tucker Taft
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Doherty @ 2001-08-23  9:03 UTC (permalink / raw)


Why does the Ada95 LRM not gaurantee a compilation error for the
following, albeit does produce a CONTRAINT_ERROR.


procedure Test is

  type Enum is (A, B, C);

  -- the following don't produce compilation errors (just warning on
different
  -- versions of the compiler 
  Lookup_1 : constant array (Enum) of Integer := (A => 1);
  Lookup_2 : constant array (Enum) of Integer := (A => 1, B => 2);
  Lookup_3 : constant array (Enum) of Integer := (B => 1, C => 3);
  Lookup_4 : constant array (Enum) of Integer := (10, 12);

  -- the following does produce compilation error (as expected)
  Lookup_5 : constant array (Enum) of Integer := (A => 1,C => 2);

begin
    null;
end Test;

p.s. Different versions of the Rational compiler (but not all) issue a
warning that ... CONSTRAINT_ERROR will be raised...



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

end of thread, other threads:[~2001-09-04 20:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-23  9:03 Constant array declarations are not causing a compilation error when not fully initialized Mark Doherty
2001-08-28 23:43 ` Tucker Taft
2001-08-29  2:07   ` tmoran
2001-09-04 20:50     ` Tucker Taft

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