fix floating point ! type
PATCH 1/1 fix floating point ! type
The expression type of zero testing should be EXPR_COMPARE, rather than EXPR_BINOP.
Signed-off-by Xi Wang <[email protected]>
--- evaluate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
evaluate.c +1 -1
@@ -1807,7 +1807,7 @@ static struct symbol *evaluate_preop(struct expression *expr)warning (expr->pos,"testing a 'safe expression'" );if (is_float_type (ctype)) {struct expression *arg = expr->unop; - expr->type =EXPR_BINOP ; + expr->type =EXPR_COMPARE ; expr->op =SPECIAL_EQUAL ; expr->left = arg; expr->right =alloc_expression (expr->pos,EXPR_FVALUE );
Signature · 1 line
1.8.1.2
Quoted 2 lines · Xi Wang
The expression type of zero testing should be
EXPR_COMPARE, rather thanEXPR_BINOP.
There might be a bigger problem. The C standard says the result type of comparisons, !, &&, || should be int, rather than bool.