aboutsummaryrefslogtreecommitdiff
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 /evaluate.c
parentfix show_typename() (diff)
downloadsparse-33b0ef36fca702b0f911f3cae11f39fe5be25e51.tar.gz
sparse-33b0ef36fca702b0f911f3cae11f39fe5be25e51.tar.bz2
sparse-33b0ef36fca702b0f911f3cae11f39fe5be25e51.zip
catch !x & y brainos
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'evaluate.c')
-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;