comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@cs.nyu.edu (Robert Dewar)
Subject: Re: Range Check Query
Date: 19 Nov 1994 11:58:58 -0500
Date: 1994-11-19T11:58:58-05:00	[thread overview]
Message-ID: <3alasi$9eg@gnat.cs.nyu.edu> (raw)
In-Reply-To: EACHUS.94Nov18121126@spectre.mitre.org

"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.




  reply	other threads:[~1994-11-19 16:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-11-18 15:27 Range Check Query Bob Wells #402
1994-11-18 12:11 ` Robert I. Eachus
1994-11-19 16:58   ` Robert Dewar [this message]
1994-11-21 10:57     ` Robert I. Eachus
1994-11-20 17:16 ` Do-While Jones
1994-11-21 16:00 ` Norman H. Cohen
1994-11-23 17:31 ` Kent Mitchell
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox