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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,76dd26495a8f3b25,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-23 02:03:59 PST Path: archiver1.google.com!news2.google.com!postnews1.google.com!not-for-mail From: Mark.Doherty@uk.thalesgroup.com (Mark Doherty) Newsgroups: comp.lang.ada Subject: Constant array declarations are not causing a compilation error when not fully initialized. Date: 23 Aug 2001 02:03:58 -0700 Organization: http://groups.google.com/ Message-ID: <2d87db3f.0108230103.6326861e@posting.google.com> NNTP-Posting-Host: 194.200.220.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 998557439 32743 127.0.0.1 (23 Aug 2001 09:03:59 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 23 Aug 2001 09:03:59 GMT Xref: archiver1.google.com comp.lang.ada:12315 Date: 2001-08-23T09:03:59+00:00 List-Id: 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...