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,ecc38b3271b36b88 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!newsfeed.neostrada.pl!unt-exc-01.news.neostrada.pl!newsfeed01.sul.t-online.de!t-online.de!news.belwue.de!LF.net!news.enyo.de!not-for-mail From: Florian Weimer Newsgroups: comp.lang.ada Subject: Re: What is the warning about builtin-function on gcc-4.6.0 ? Date: Sat, 26 Mar 2011 18:02:01 +0100 Message-ID: <8762r5hl2u.fsf@mid.deneb.enyo.de> References: <87aagiclte.fsf@mid.deneb.enyo.de> <475d10ca-5d4e-490c-9b88-e12cd3cd3faa@b13g2000prf.googlegroups.com> <87d3lejjyv.fsf@mid.deneb.enyo.de> <6c748f70-7e75-49b4-a467-d1d2d6b24323@w9g2000prg.googlegroups.com> <87k4flhoeg.fsf@mid.deneb.enyo.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ruchba.enyo.de 1301158921 20273 172.17.135.6 (26 Mar 2011 17:02:01 GMT) X-Complaints-To: news@enyo.de Cancel-Lock: sha1:mHBL1CbvKiCUQdEyvNgARyjwc1g= Xref: g2news2.google.com comp.lang.ada:19444 Date: 2011-03-26T18:02:01+01:00 List-Id: * Simon Wright: > Florian Weimer writes: > >> * Simon Wright: >> >>> ytomino writes: >>> >>>> nn...then, there are no function to take infinity and NaN... >>> >>> 'Valid should do the trick. >>> >>> FP_Value := 1.0 / 0.0; >>> if FP_Value'Valid then >>> -- it won't be >> >> This is a compiler bug. > > I don't understand what you mean. The standard requires that FP_Value'Valid is true. > If the compiler doesn't raise an exception on division by zero (it's > allowed not to, and GNAT doesn't) it will (in this case) set the result > to +Inf, and 'Valid will return False. My understanding is that an implementation must either raise Constraint_Error, or the evaluation of an expression must result in a valid value.