comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: How to compile Barnes' examples from his book using GNAT
Date: Mon, 7 Dec 2015 20:01:22 -0600
Date: 2015-12-07T20:01:22-06:00	[thread overview]
Message-ID: <n45dlj$rgn$1@loke.gir.dk> (raw)
In-Reply-To: n42cuc$nqs$1@dont-email.me

"Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org> 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.


  reply	other threads:[~2015-12-08  2:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-06 10:49 How to compile Barnes' examples from his book using GNAT Jerry
2015-12-06 11:24 ` Brian Drummond
2015-12-06 18:17   ` Jeffrey R. Carter
2015-12-06 21:21     ` Pascal Obry
2015-12-06 22:33       ` Jeffrey R. Carter
2015-12-08  2:01         ` Randy Brukardt [this message]
2015-12-07  9:01   ` Jerry
2015-12-07  9:36     ` Jacob Sparre Andersen
2015-12-10  3:26       ` Jerry
2015-12-10  8:55         ` J-P. Rosen
2015-12-10 12:34           ` G.B.
2015-12-07 14:21     ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox