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 X-Google-Thread: 103376,3b637950a34ec2d6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-15 08:34:23 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: Mark.Doherty@uk.thalesgroup.com (Mark Doherty) Newsgroups: comp.lang.ada Subject: Re: Discriminated record question Date: 15 May 2002 08:34:22 -0700 Organization: http://groups.google.com/ Message-ID: <2d87db3f.0205150734.47a94f8d@posting.google.com> References: <2d87db3f.0205080210.34726bf3@posting.google.com> <5ee5b646.0205081856.63e2639e@posting.google.com> NNTP-Posting-Host: 195.173.4.13 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1021476863 19270 127.0.0.1 (15 May 2002 15:34:23 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 15 May 2002 15:34:23 GMT Xref: archiver1.google.com comp.lang.ada:24099 Date: 2002-05-15T15:34:23+00:00 List-Id: > > > Does the compiler have the freedom to raise it as a > > Constraint_Error? > > Highly dubious if you ask me. Report it as a bug. > Rational responce was ... It's confirmed that Constraint_Error is raised due to a limit being exceeded. Specifically, the size of an object of type B_Type (see below) cannot be represented in (signed) 32 bits. type B_Type (Text_Size : Natural := 0) is record Text : String (1 .. Text_Size); end record; This is covered by RM95 section 1.1.3: 2 � Translate and correctly execute legal programs written in Ada, provided that they are not so large as to exceed the capacity of the implementation; 3 � Identify all programs or program units that are so large as to exceed the capacity of the implementation (or raise an appropriate exception at run time); 3.a Implementation defined: Capacity limitations of the implementation. A key term is "appropriate exception" and, clearly, the Apex compiler has chosen to report implementation capacity overflow with a Constraint_Error. I note that section 11.1 (6) states: The execution of any construct raises Storage_Error if there is insufficient storage for that execution. Thus it might be argued that the RM95 is inconsistent, or should better define "appropriate exception", although I prefer to leave such discussion to greater minds than mine. Whatever, the Apex compiler is consistent with the language specification and therefore correct. ... Seems like a weak justifcation to me!