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.58.94.232 with SMTP id df8mr2913429veb.23.1400103468218; Wed, 14 May 2014 14:37:48 -0700 (PDT) X-Received: by 10.50.67.106 with SMTP id m10mr907594igt.5.1400103468117; Wed, 14 May 2014 14:37:48 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!c1no6806248igq.0!news-out.google.com!gi6ni1825igc.0!nntp.google.com!r10no4690097igi.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 14 May 2014 14:37:47 -0700 (PDT) In-Reply-To: <224148c3-2a31-4f3e-a3a3-0a588773798b@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=KSa2aQoAAACOxnC0usBJYX8NE3x3a1Xq NNTP-Posting-Host: 66.126.103.122 References: <50562e0a-3dfa-44c4-9aaa-70cbe304b54b@googlegroups.com> <40c7405d-c4c2-4163-a430-01052b769866@googlegroups.com> <049c868a-e930-4e5d-a96a-611542cd1ce6@googlegroups.com> <224148c3-2a31-4f3e-a3a3-0a588773798b@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Bug or feature? From: Adam Beneschan Injection-Date: Wed, 14 May 2014 21:37:48 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:19831 Date: 2014-05-14T14:37:47-07:00 List-Id: On Wednesday, May 14, 2014 2:24:57 PM UTC-7, Laurent wrote: > Modified my little test with Result:=3D 2_000_000_000 + 2_000_000_000; > Doesn't compile: >=20 > /Volumes/Kingston/GPS/Chapter 14/buffer_overflow.adb > 11:27 static expression fails Constraint_Check > 11:27 value not in range of type "Standard.Integer" Yes, you have to use variables. 2_000_000_000 + 2_000_000_000 is a static = expression that can be computed at compile-time, and some of the checks tha= t would normally cause exceptions at run-time will cause errors at compile-= time, due to special rules in the language about static expressions. =20 > So it is a bug? Or just a matter of putting an additional flag? The requirement to add -gnato to get full checking has been discussed quite= a bit on this newsgroup and elsewhere. Basically, overflow checking adds = a lot of code on most processors, and I think the decision was made early o= n to disable it by default. Not everyone likes this. It looks like there'= s a bug in how range checking is handled if -gnato isn't used, over and abo= ve the lack of overflow checking. But it appears to be a bug that cannot c= ome up if -gnato is used. -- Adam