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 10.200.25.194 with SMTP id s2mr25782373qtk.1.1509284528449; Sun, 29 Oct 2017 06:42:08 -0700 (PDT) X-Received: by 10.157.41.135 with SMTP id n7mr580797otb.5.1509284528412; Sun, 29 Oct 2017 06:42:08 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.fcku.it!peer02.fr7!futter-mich.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!z50no4780481qtj.0!news-out.google.com!v14ni3100qtc.0!nntp.google.com!k31no4795529qta.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 29 Oct 2017 06:42:08 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:18f:900:f900:6600:6aff:fe37:6bdc; posting-account=3pYsyQoAAACcI-ym7XtMOI2PDU8gRZS5 NNTP-Posting-Host: 2601:18f:900:f900:6600:6aff:fe37:6bdc References: <81f4fbf9-fef3-4592-a95e-64889e564df4@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: What am I doing wrong with contracts? Why are they succeeding when they should be failing? From: Andrew Shvets Injection-Date: Sun, 29 Oct 2017 13:42:08 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Body-CRC: 722151556 X-Received-Bytes: 2362 Xref: news.eternal-september.org comp.lang.ada:48625 Date: 2017-10-29T06:42:08-07:00 List-Id: On Sunday, October 29, 2017 at 3:20:15 AM UTC-4, joak...@kth.se wrote: > Den s=C3=B6ndag 29 oktober 2017 kl. 03:42:07 UTC+1 skrev Andrew Shvets: > > On Saturday, October 28, 2017 at 8:34:12 PM UTC-4, Andrew Shvets wrote: > > > I think I'm misunderstanding how proofs/contracts work at some fundam= ental level. Hence my confusion. > >=20 > > I figured it out, I needed to have the following at the top of where th= e contract was written in order to have it be checked/enforced: > >=20 > > pragma Assertion_Policy(Check); > >=20 > > I'm reading more about this right now. >=20 > To get run-time checks for the contracts you need to use the gcc Enable A= ssertions flag "-gnata" during compilation. >=20 > Best regards, > Joakim I just tried this. It works. Thanks for the tip.