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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a6b:e30e:: with SMTP id u14mr3998126ioc.13.1554136894799; Mon, 01 Apr 2019 09:41:34 -0700 (PDT) X-Received: by 2002:a9d:7342:: with SMTP id l2mr46689878otk.56.1554136894652; Mon, 01 Apr 2019 09:41:34 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!78no16820itl.0!news-out.google.com!r82ni30ita.0!nntp.google.com!136no16773itk.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 1 Apr 2019 09:41:34 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=84.131.49.43; posting-account=rmHyLAoAAADSQmMWJF0a_815Fdd96RDf NNTP-Posting-Host: 84.131.49.43 References: <36c2ff61-8cca-4435-995f-dfc34fa44b69@googlegroups.com> <511923fb-dbb9-4e33-82a8-b4bbbf002a6d@googlegroups.com> <5762bd48-9e87-4b77-a517-a4e62dec071b@googlegroups.com> <83811f34-a797-455c-9909-e5641a88a285@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <51c79236-9828-4a84-b41d-6fc5a9e69579@googlegroups.com> Subject: Re: type definition for an integer with discrete range From: AdaMagica Injection-Date: Mon, 01 Apr 2019 16:41:34 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:56029 Date: 2019-04-01T09:41:34-07:00 List-Id: Am Montag, 1. April 2019 18:27:32 UTC+2 schrieb Simon Wright: > AdaMagica writes: > > > Am Montag, 1. April 2019 08:59:56 UTC+2 schrieb mario.b...@gmail.com: > >> Thanks, it is nearly perfect now :-) > >> The line 24 in the file > >> https://github.com/Blunk-electronic/ada_training/blob/master/src/type_angle/type_angle.adb > >> Should produce an error at compile time. Apart from this "nice to > >> have" the program does what I want. > > > > You have to make sure that "pragma Assertion_Policy (Check);" is set. > > Yes, that's why it appears at the top of the program. Oh, I missed this. > Alternatively you could compile with -gnata. > > If I have the Assertion_Policy pragma in spec A, and package B uses that > spec, are the assertions specified in A applied in B? (I suspect not) You're right with your suspicion. That's why this pragma is a "configuration pragma"; it should be in a special file (compiler dependent), then it applies to all units to which this config file applies. Or, for GNAT only, you use -gnata, as you said above.