Martin Liddle wrote:
In article TkL6xoBnC3C8EwoC@tcs02.demon.co.uk, Martin Liddle martin@tcs02.demon.co.uk writes
I have observed one more, possibly cosmetic, problem which I will investigate and attempt to produce a test program to demonstrate.
I have now investigated this problem. The compiler was reporting "warning: comparison is always 'True' due to the limited range of data type" for an expression such as:
If (Check[Control].ChecH<24) and (Check[Control].ChecH>=0) then
where ChecH is a field in a packed record defined as follows:
TAudit1=Packed Record ChecH:0..47; ChecM:0..60; .... End;
This problem was present in both the 20010604 and 20011123 versions of the compiler. I am pleased to say that using the patched version of the 20011123 compiler has eliminated the spurious warning:-) Thank you
I suppose the packed record was declared in a unit as well (otherwise I'd be surprised if my change affected this case).
However, the warning was actually not spurious since `CheckH >= 0' is indeed always True. But I'm not too worried, since we haven't implemented such warnings rigorously (only in some special cases, mostly inherited from C). But we may do this in the future, and then you'll get this warning again. Be prepared. ;-)
Frank