diff options
author | Chad Loder <cloder@cvs.openbsd.org> | 2005-12-12 23:40:38 +0000 |
---|---|---|
committer | Chad Loder <cloder@cvs.openbsd.org> | 2005-12-12 23:40:38 +0000 |
commit | a2efe9d6d463e46b7e235c3f5f889ede44fdc189 (patch) | |
tree | f00ef722e7710b87890e9ab71973936a12927c1e | |
parent | 25940ee1f068ec6dba0601e1979719912002325d (diff) |
Restructure conditional from last checkin regarding constant in conditional
contexts, so that we do not lose the ability to warn on non-integer
constants.
-rw-r--r-- | usr.bin/xlint/lint1/tree.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/xlint/lint1/tree.c b/usr.bin/xlint/lint1/tree.c index 54b7c8545d4..f36ebdfe0ca 100644 --- a/usr.bin/xlint/lint1/tree.c +++ b/usr.bin/xlint/lint1/tree.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tree.c,v 1.23 2005/12/12 23:35:59 cloder Exp $ */ +/* $OpenBSD: tree.c,v 1.24 2005/12/12 23:40:37 cloder Exp $ */ /* $NetBSD: tree.c,v 1.12 1995/10/02 17:37:57 jpo Exp $ */ /* @@ -33,7 +33,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: tree.c,v 1.23 2005/12/12 23:35:59 cloder Exp $"; +static char rcsid[] = "$OpenBSD: tree.c,v 1.24 2005/12/12 23:40:37 cloder Exp $"; #endif #include <stdlib.h> @@ -3322,9 +3322,9 @@ expr(tnode_t *tn, int vctx, int tctx) warning(159); } else if (tn->tn_op == CON) { if (hflag && tctx && !ccflg) { - if (isityp(tn->tn_type->t_tspec) && - tn->tn_val->v_quad != 0 && - tn->tn_val->v_quad != 1) { + if (!isityp(tn->tn_type->t_tspec) || + (tn->tn_val->v_quad != 0 && + tn->tn_val->v_quad != 1)) { /* constant in conditional context */ warning(161); } |