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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,e387f06de055df74 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.180.8.4 with SMTP id n4mr1336047wia.0.1359540922962; Wed, 30 Jan 2013 02:15:22 -0800 (PST) Path: bp2ni5975wib.1!nntp.google.com!feeder1.cambriumusenet.nl!82.197.223.108.MISMATCH!feeder2.cambriumusenet.nl!feed.tweaknews.nl!195.96.0.7.MISMATCH!newsfeed.utanet.at!texta.sil.at!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Odd overflow exception being raised in one-line program Date: Wed, 30 Jan 2013 10:15:23 +0000 Organization: A noiseless patient Spider Message-ID: References: <8259d65f-4b81-49d2-b1a0-613072c6b0fe@googlegroups.com> Mime-Version: 1.0 Injection-Info: mx05.eternal-september.org; posting-host="c8da4aa61d590a5e477a2e03e552a940"; logging-data="24801"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+a+iHC+D9conNPFlQHw3Tsc3ajAEqUtLI=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (darwin) Cancel-Lock: sha1:EL+KXfjTlHO6X5w2+qQZHsAD+80= sha1:QWNC5ZoQZ4BDTeWZXeEENS9FtkM= Content-Type: text/plain Date: 2013-01-30T10:15:23+00:00 List-Id: Jerry writes: > A user of the PLplot plotting package, using Ada bindings, has > reported an overflow exception that has not occurred before. He > reports using Fedora rawhide which uses gcc 4.8. He reported the > conditions surrounding the exception and I used that to make the > following program and asked him to report his results. Line 7 of the > below program mimics a line in the Ada binding to which his exception > points. > r := Integer((r1 * 255.001) - 0.499999999999999); > raised CONSTRAINT_ERROR : Test_Overflow.adb:7 overflow check failed > I investigated other places (18 total) where he is getting an > "overflow check failed" exception. In every case, the indicated line > contains a conversion from Long_Float to Integer using the Integer( ) > function with a Long_Float argument. It appears very likely that the > exception is happening at every attempt to make such a conversion. > > What am I missing here? Well, GCC 4.8 hasn't been released yet! but a quick check through the bugs/regressions doesn't show anything like this. Let's hope it doesn't make it to the release .. Neither GCC 4.7.0 nor GNAT GPL 2012 shows the problem.