Split the test for assignment and parenthesis.

This will make it easier to fix the internal error for "if (x = 0)".
This commit is contained in:
Bill Currie 2012-12-23 14:55:16 +09:00
parent b9a0e2ce03
commit 82ded2b638

View file

@ -1176,9 +1176,8 @@ convert_bool (expr_t *e, int block)
{
expr_t *b;
if (e->type == ex_expr && (e->e.expr.op == '=' || e->e.expr.op == PAS)
&& !e->paren) {
if (options.warnings.precedence)
if (e->type == ex_expr && (e->e.expr.op == '=' || e->e.expr.op == PAS)) {
if (!e->paren && options.warnings.precedence)
warning (e, "suggest parentheses around assignment "
"used as truth value");
}