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,e258612d447226e4 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-11-20 03:39:08 PST Path: nntp.gmd.de!xlink.net!howland.reston.ans.net!gatech!udel!news.mathworks.com!panix!cmcl2!thecourier.cims.nyu.edu!thecourier.cims.nyu.edu!nobody From: dewar@cs.nyu.edu (Robert Dewar) Newsgroups: comp.lang.ada Subject: Re: Range Check Query Date: 19 Nov 1994 11:58:58 -0500 Organization: Courant Institute of Mathematical Sciences Message-ID: <3alasi$9eg@gnat.cs.nyu.edu> References: <9411181527.AA08827@eurocontrol.de> NNTP-Posting-Host: gnat.cs.nyu.edu Date: 1994-11-19T11:58:58-05:00 List-Id: "If the compiler is smart enough [to recognize that a comparison of a value of limited range with a constant is always False], it should probably warn .." First, that's not an easy check to do, it certainly doesn't fall out free, because it requires the generalized notion of the subtype of a result, where in the language we are only ever interested in the base type for operands of an operator. Certainly it could be done with a special check. Second, are you really *sure* that you want this warning. Yes I know you can suppress warnings, but the trick is to keep warnings useful so that people don't need to suppress them in normal cases. I an very dubious that this is a desirable approach Robert Eachus' analysis of the original question is certainly quite correct, there is no basis to expect range constraint to be raised in either situation.