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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.224.172.129 with SMTP id l1mr32908793qaz.4.1373676729406; Fri, 12 Jul 2013 17:52:09 -0700 (PDT) X-Received: by 10.50.4.38 with SMTP id h6mr307528igh.8.1373676729193; Fri, 12 Jul 2013 17:52:09 -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.bbs-scene.org!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!t19no1401342qam.0!news-out.google.com!f7ni2314qai.0!nntp.google.com!t19no1401341qam.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 12 Jul 2013 17:52:08 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=97.117.192.199; posting-account=x5rpZwoAAABMN2XPwcebPWPkebpwQNJG NNTP-Posting-Host: 97.117.192.199 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <74c64a2c-f062-4b59-aafb-40c0bac39203@googlegroups.com> Subject: GNAT does not consistently raise an exception to log(0.0) From: Jerry Injection-Date: Sat, 13 Jul 2013 00:52:09 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:16336 Date: 2013-07-12T17:52:08-07:00 List-Id: When the following program is built with any of theses compilers: GNATMAKE GPL 2013 (20130314) (downloaded from AdaCore) GNATMAKE GPL 2011 (20110419) (downloaded from AdaCore) GNATMAKE 4.8.0 (Simon Wright's build) like this: $ gnatmake -f bomb_log.adb -OX then if X = 0 (zero) the expected exception is raised and reported thusly: raised CONSTRAINT_ERROR : a-ngelfu.adb:744 explicit raise else if X > 0 no exception is raised. with Ada.Numerics.Long_Elementary_Functions; use Ada.Numerics.Long_Elementary_Functions; procedure Bomb_Log is x : Long_Float; begin x := log(0.0); end Bomb_Log; However, under the same conditions as above, the following program raises the exception always: with Ada.Numerics.Long_Elementary_Functions; use Ada.Numerics.Long_Elementary_Functions; with Ada.Text_IO; use Ada.Text_IO; procedure Bomb_Log is x : Long_Float; begin x := log(0.0); Put_Line(Long_Float'Image(x)); end Bomb_Log; Jerry P.S. What is the meaning of -O99999 as a gnatmake argument?