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,LOTS_OF_MONEY autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b6062cca52b2d096 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-02-01 14:13:59 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!news-out.cwix.com!newsfeed.cwix.com!wn2feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc53.POSTED!not-for-mail From: "Steve Doiel" Newsgroups: comp.lang.ada References: <5ee5b646.0202011311.393ce8d9@posting.google.com> Subject: Re: Valid on QNaN generates exception, compiler bug? X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Message-ID: NNTP-Posting-Host: 12.225.227.101 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc53 1012601638 12.225.227.101 (Fri, 01 Feb 2002 22:13:58 GMT) NNTP-Posting-Date: Fri, 01 Feb 2002 22:13:58 GMT Organization: AT&T Broadband Date: Fri, 01 Feb 2002 22:13:58 GMT Xref: archiver1.google.com comp.lang.ada:19508 Date: 2002-02-01T22:13:58+00:00 List-Id: Thank you Robert. I was hoping for a response from either you or Tuck (one I can trust). SteveD "Robert Dewar" wrote in message news:5ee5b646.0202011311.393ce8d9@posting.google.com... > "Steve Doiel" wrote in message news:... > > Interesting. I expected float_value'Valid to return > > false, not raise an > > exception. > > And of course your expectation was entirely correct. This > is a clear bug (some earlier version of GNAT had this bug, > and for a while we actually installed an implicit exception > handler to catch the bogus exception and return False, but > now GNAT does explicit code to test for and catch NaN's > and infinities. The problem is that a signalling NaN may > raise an exception just by loading it. > > But the prefix of 'Valid is very special. As we read in > 13.9.2, the ONLY way you can use an invalid value like > a NaN is in this context: > > 12 (20) X'Valid is not considered to be a read of X; > hence, it is not an > error to check the validity of invalid data. > > There is no basis whatsoever for raising a Constraint_Error > here, the program is correct, and the 'Valid attribute > should yield False. Report the bug to the relevant vendor. > > You definitely do NOT need to guard all 'Valid attributes > with an exception handler (which is what the previous > incorrect response would have implied).