aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2008-02-22 23:05:35 +0000
committerJosh Triplett <josh@freedesktop.org>2008-04-03 13:48:47 -0700
commit33b0ef36fca702b0f911f3cae11f39fe5be25e51 (patch)
tree4cf2204c480ea1106e054e3cd2dc0e0ad8452a77
parent64b65ec931369939014995e65b682effa7c0a654 (diff)
downloadsparse-33b0ef36fca702b0f911f3cae11f39fe5be25e51.tar.gz
sparse-33b0ef36fca702b0f911f3cae11f39fe5be25e51.tar.xz
sparse-33b0ef36fca702b0f911f3cae11f39fe5be25e51.zip
catch !x & y brainos
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--evaluate.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/evaluate.c b/evaluate.c
index 2901c1b..4928584 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -917,6 +917,9 @@ static struct symbol *evaluate_binop(struct expression *expr)
rtype = integer_promotion(rtype);
} else {
// The rest do usual conversions
+ if (op == '&' && expr->left->type == EXPR_PREOP &&
+ expr->left->op == '!')
+ warning(expr->pos, "dubious: !x & y");
ltype = usual_conversions(op, expr->left, expr->right,
lclass, rclass, ltype, rtype);
ctype = rtype = ltype;