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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!talisker.lacave.net!lacave.net!news.ecp.fr!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: How to compile Barnes' examples from his book using GNAT Date: Mon, 7 Dec 2015 20:01:22 -0600 Organization: JSA Research & Innovation Message-ID: References: <2c68ffdd-f55e-4c68-84f1-fbe0f83a0b57@googlegroups.com> <1449436915.3174.17.camel@obry.net> NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1449540083 28183 24.196.82.226 (8 Dec 2015 02:01:23 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 8 Dec 2015 02:01:23 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:28697 Date: 2015-12-07T20:01:22-06:00 List-Id: "Jeffrey R. Carter" wrote in message news:n42cuc$nqs$1@dont-email.me... > On 12/06/2015 02:21 PM, Pascal Obry wrote: >> >>> Almost. However, with no options, GNAT is not an Ada compiler. It >>> doesn't insert >>> integer-overflow checks, >> >> Recent GNAT versions have overflow on by default. > > That's good. When I had checked not too long ago, it was still off by > default. > >>> stack-overflow checks, assertion checks, pre- and >>> post-condition checks, predicate checks, or invariant checks. >> >> The assertions and aspects checks are optional for an Ada compiler and >> can be turned on and off. > > True, but examples from the book intended to demonstrate the use of these > features may not behave as described if they are not turned on. I would guess that most people starting out would expect that the default would be for them to be on. I got caught by it writing ACATS tests. The main reason the language doesn't say is that we didn't want to change the behavior of existing compilers (many of which had pragma Assert when it was added to the language). But that probably is the wrong choice for preconditions, predicates, and so on. Randy.