Chill warning questions #2
Joe Buck
jbuck@synopsys.com
Mon Oct 12 16:07:00 GMT 1998
> 1. Where should the parens go?
>
> expr.c: In function `build_chill_card':
> expr.c:1376: warning: suggest parentheses around comparison in operand of &
>
> > if (TREE_CODE (powerset) == CONSTRUCTOR & TREE_CONSTANT (powerset)
> > && (size = int_size_in_bytes (TREE_TYPE (powerset))) >= 0)
I think that the & should be an &&.
> 3. Who here needs a cast, and to what?
>
> expr.c: In function `chill_expand_expr':
> expr.c:232: warning: comparison between signed and unsigned
>
> > if (mode != Pmode && modifier == EXPAND_SUM)
Why is this warning being issued for != and == comparisons? The
reason for this warning is that relational comparisons (<, <=, >, >=)
have unexpected results when comparing negative signed values to
unsigned values. Since there is no unexpected behavior for != or
==, I don't believe that the compiler should warn in this case.
More information about the Gcc
mailing list