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.236.109.169 with SMTP id s29mr2556522yhg.43.1400102697362; Wed, 14 May 2014 14:24:57 -0700 (PDT) X-Received: by 10.140.36.6 with SMTP id o6mr53199qgo.26.1400102697251; Wed, 14 May 2014 14:24:57 -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!r10no4683252igi.0!news-out.google.com!qf4ni926igc.0!nntp.google.com!c1no6796966igq.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 14 May 2014 14:24:57 -0700 (PDT) In-Reply-To: <049c868a-e930-4e5d-a96a-611542cd1ce6@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=87.240.222.153; posting-account=sDyr7QoAAAA7hiaifqt-gaKY2K7OZ8RQ NNTP-Posting-Host: 87.240.222.153 References: <50562e0a-3dfa-44c4-9aaa-70cbe304b54b@googlegroups.com> <40c7405d-c4c2-4163-a430-01052b769866@googlegroups.com> <049c868a-e930-4e5d-a96a-611542cd1ce6@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <224148c3-2a31-4f3e-a3a3-0a588773798b@googlegroups.com> Subject: Re: Bug or feature? From: Laurent Injection-Date: Wed, 14 May 2014 21:24:57 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:19829 Date: 2014-05-14T14:24:57-07:00 List-Id: Hi Using GNAT and GPS. Didn't change anything on the compiler flags. >When you ran the small test program, what value did you put in for N? I used 10. This one I didn't see: 5*2_000_000_000 =3D 1_410_065_408 So there is also an overflow. Didn't count the digits before. (Is there a w= ay to add '_' to separate the thousands automatically in GPS?) Seems this behavior happens only with functions. Yeah my test is quite cheap. Was more to see if I coded something strange t= ogether or if it is an other problem. Modified my little test with Result:=3D 2_000_000_000 + 2_000_000_000; Doesn't compile: /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" So it is a bug? Or just a matter of putting an additional flag? Checked the Stack Overflow check (-gnato) under Project Properties/Switches= /Ada and disabling my own overflow detection the fibonacci program(iteratio= n or recursion) crashes with Constraint Error. The behavior I expected. I a= m a bit disappointed/afraid of this. Or perhaps I have forgotten to read th= e small printed text somewhere at the end :) Thanks Laurent