Warning flags for unsigned operations (unsafe)
Thomas R. Truscott
trt@cs.duke.edu
Wed Sep 22 15:38:00 GMT 2004
> I couldn't find out if gcc had a
> warning flag for unsigned operation. For example, even the linear
> interpolation on [a,b] can be tricky to code:
>
> c = a + t * (b - a); //unsafe
Not for this situation. I think a warning would be appropriate
when an unsigned quantity involving subtraction
is widened or converted to double.
> Your code has a design flaw and is not valid.
Uh, that misses the whole point of warning messages, doesn't it?
Tom Truscott
More information about the Gcc
mailing list