This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Chill warning questions #2


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]