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=0.5 required=5.0 tests=BAYES_00,HK_RANDOM_FROM, INVALID_MSGID,PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 109fba,98ad5b2a2cd88a53 X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,98ad5b2a2cd88a53 X-Google-Attributes: gid103376,public From: bglbv@my-dejanews.com Subject: Re: Ada or C++ acting 'correctly' here? Date: 1999/03/18 Message-ID: <87pv66wjgv.fsf@bglbv.my-dejanews.com>#1/1 X-Deja-AN: 456289061 References: <7b8c7u$sj1@drn.newsguy.com> <36e8e201.48455851@netnews.worldnet.att.net> X-Complaints-To: abuse@theplanet.net X-Trace: news4.svr.pol.co.uk 921800372 2658 62.136.3.117 (18 Mar 1999 23:39:32 GMT) Organization: Customer of Planet Online NNTP-Posting-Date: 18 Mar 1999 23:39:32 GMT Newsgroups: comp.lang.ada,comp.lang.c++ Date: 1999-03-18T23:39:32+00:00 List-Id: > > > cout<<(500000000*7); > > Quotation from ISO/IEC 14882:1998(E), Chapter 5 (Expressions): > > | 5 If during the evaluation of an expression, the result is not > > | mathematically defined or not in the range of representable values > > | for its type, the behavior is undefined, unless such an expression is > > | a constant expression (5.19), in which case the program is ill-formed. > > The standard doesn't mention that no diagnonstic is required, so > > conforming implementations have to refuse to compile this program. > The standard does not have to mention that no diagnostic is required > if undefined behavior is involved. A diagnostic is never required for > undefined behavior. Among other things, requiring a diagnostic would > be defining a behavior. The point here is that (500000000*7) is a constant expression (would someone who has read �5.19 please confirm this?) and the program is therefore ill-formed. The wording of the passage quoted above contrasts this situation with the more general case where the behavior is undefined; one is therefore tempted to read it as meaning that a diagnostic *is* required in this particular case.