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.55.170.83 with SMTP id t80mr11979435qke.20.1509306105930; Sun, 29 Oct 2017 12:41:45 -0700 (PDT) X-Received: by 10.157.41.135 with SMTP id n7mr617545otb.5.1509306105894; Sun, 29 Oct 2017 12:41:45 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!goblin3!goblin.stu.neva.ru!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!k31no5011617qta.1!news-out.google.com!r5ni5177qtc.1!nntp.google.com!z50no4996465qtj.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 29 Oct 2017 12:41:45 -0700 (PDT) In-Reply-To: <81e99a7c-175a-42e8-82bb-83bebd5d4e68@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:18f:900:f900:890b:5da7:fc3a:7d41; posting-account=3pYsyQoAAACcI-ym7XtMOI2PDU8gRZS5 NNTP-Posting-Host: 2601:18f:900:f900:890b:5da7:fc3a:7d41 References: <81f4fbf9-fef3-4592-a95e-64889e564df4@googlegroups.com> <81e99a7c-175a-42e8-82bb-83bebd5d4e68@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <6a777f1d-ece9-4c50-a451-25aa7defd549@googlegroups.com> 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 19:41:45 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:48638 Date: 2017-10-29T12:41:45-07:00 List-Id: On Sunday, October 29, 2017 at 3:17:15 PM UTC-4, Anh Vo wrote: > On Sunday, October 29, 2017 at 6:42:09 AM UTC-7, Andrew Shvets wrote: > > 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 Shvet= s: > > > > On Saturday, October 28, 2017 at 8:34:12 PM UTC-4, Andrew Shvets wr= ote: > > > > > I think I'm misunderstanding how proofs/contracts work at some fu= ndamental level. Hence my confusion. > > > >=20 > > > > I figured it out, I needed to have the following at the top of wher= e the 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 Enab= le Assertions flag "-gnata" during compilation. > > >=20 > > > Best regards, > > > Joakim > >=20 > > I just tried this. It works. Thanks for the tip. >=20 > I would prefer using pragma Assertion_Policy(Check) since it is 100% port= able. >=20 > Anh Vo I agree. That I'd forget the compiler flag from time to time and think my = code was working when it wasn't.