+2007-01-23 Ian Lance Taylor <iant@google.com>
+
+ * typeck.c (convert_for_assignment): Only warn about a = b = c
+ when converting to bool.
+
2007-01-23 Roger Sayle <roger@eyesopen.com>
* call.c (null_ptr_cst_p): Replace use of TREE_CONSTANT_OVERFLOW with
errtype);
}
- /* If -Wparentheses, warn about a = b = c when a has type bool. */
+ /* If -Wparentheses, warn about a = b = c when a has type bool and b
+ does not. */
if (warn_parentheses
&& type == boolean_type_node
&& TREE_CODE (rhs) == MODIFY_EXPR
- && !TREE_NO_WARNING (rhs))
+ && !TREE_NO_WARNING (rhs)
+ && TREE_TYPE (rhs) != boolean_type_node)
{
warning (OPT_Wparentheses,
"suggest parentheses around assignment used as truth value");