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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9c0aeffddd5a8549 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-01-21 21:10:53 PST Path: pad-thai.cam.ov.com!bloom-beacon.mit.edu!apollo.hp.com!lf.hp.com!hpscit.sc.hp.com!news.dtc.hp.com!col.hp.com!csn!ncar!gatech!swrinde!pipex!uunet!panix!cmcl2!thecourier.cims.nyu.edu!thecourier.cims.nyu.edu!nobody From: dewar@cs.nyu.edu (Robert Dewar) Newsgroups: comp.lang.ada Subject: Re: Need help with DEC Ada Date: 20 Jan 1995 00:22:54 -0500 Organization: Courant Institute of Mathematical Sciences Message-ID: <3fnhbe$4lq@gnat.cs.nyu.edu> References: <19950117.160119.606@vnet.ibm.com> NNTP-Posting-Host: gnat.cs.nyu.edu Date: 1995-01-20T00:22:54-05:00 List-Id: Mats says: "the original (2**31)-1 should not cause any problem. Ae you really sure it generates a warning ?" sorry Mats, that is wrong, in Ada 83, this expression was not a static expression evaluated at compile time, and hence a compiler is allowed to compute it at runtime, insisting that all intermediate values are in range of the type (in this case a 32 bit integer). So Dec Ada is perfectly correct (just not very friendly) in raising CE in this situation. Whatever model you have that says that this should not cause any problem is flawed with respect to Ada 83. However, as I pointed out in a previous message, Ada 95 has "fixed" this "problem" by requiring static expressions to be evaluated exactly, even when they appear as subexpressions of non static exprssions, or in contexts not requiring static expressions.