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.2 required=5.0 tests=BAYES_00,FROM_DOMAIN_NOVOWEL, INVALID_DATE,MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site sdcrdcf.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!ittatc!dcdwest!sdcsvax!sdcrdcf!markb From: markb@sdcrdcf.UUCP (Mark Biggar) Newsgroups: net.lang.ada Subject: Re: CONSTRAINT ERROR raised at runtime Message-ID: <2596@sdcrdcf.UUCP> Date: Fri, 24-Jan-86 13:37:24 EST Article-I.D.: sdcrdcf.2596 Posted: Fri Jan 24 13:37:24 1986 Date-Received: Sun, 26-Jan-86 04:04:48 EST References: <640@decwrl.DEC.COM> Reply-To: markb@sdcrdcf.UUCP (Mark Biggar) Organization: System Development Corporation R&D, Santa Monica List-Id: In article <640@decwrl.DEC.COM> cook@katie.DEC (Neil on 225-7155) writes: >> LNTH : NATURAL range 1..8 := 0; > >In the index of ANSI/MIL-STD-1815A-1983 (The Programming Language >Ada Reference Manual), under the entry CONSTRAINT_ERROR, is a reference >to "raised by the initialization of an object 3.2.1". > >In that section, paragraph 16, it says "The initialization of an object >... checks that the initial value belongs to the subtype of the >object ... The exception CONSTRAINT_ERROR is raised if this check fails." > >I take "The initialization..." to be a reference to the run-time >behaviour. Since the run-time environment raises CONSTRAINT_ERROR, I think >the compiler behaves correctly. A very close reading of the LRM shows that there is no reason why the compiler shouldn't complain, it just doesn't have to. Section 1.6 para 5 says: "If an exception is certain to be raised in every execution of a program, then compilers are allowed (although not required) to report this fact at compilation time." So the compiler DOES behave correctly, it just could have behaved in a more user friendly way then it did. Mark Biggar {allegra,burdvax,cbosgd,hplabs,ihnp4,akgua,sdcsvax}!sdcrdcf!markb