diff options
author | Chad Loder <cloder@cvs.openbsd.org> | 2005-11-28 03:12:53 +0000 |
---|---|---|
committer | Chad Loder <cloder@cvs.openbsd.org> | 2005-11-28 03:12:53 +0000 |
commit | 6d9a724617112d4a141e7ea970081d033a282cad (patch) | |
tree | f2d27f3d7a4b8d4e7f20b1e642b5f36f429adcf0 /usr.bin/xlint/lint1 | |
parent | f1b650e3f26cc44d796780ef1118e38f52c5f099 (diff) |
Set m_balance to 0 for the COLON operator, thus avoiding a false positive.
In the "question mark" construct, there is no balancing or conversions
between the LHS and RHS of the colon; thus, there is no need for the LHS
and RHS of the colon to be of compatible types (as long as the LHS and RHS
are each compatible with the lvalue of the expression having the question
mark expression as the rvalue. Currently lint doesn't verify that.
Diffstat (limited to 'usr.bin/xlint/lint1')
-rw-r--r-- | usr.bin/xlint/lint1/tree.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/xlint/lint1/tree.c b/usr.bin/xlint/lint1/tree.c index 15b983b7543..0f615d79a26 100644 --- a/usr.bin/xlint/lint1/tree.c +++ b/usr.bin/xlint/lint1/tree.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tree.c,v 1.12 2005/11/28 01:04:18 cloder Exp $ */ +/* $OpenBSD: tree.c,v 1.13 2005/11/28 03:12:52 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.12 2005/11/28 01:04:18 cloder Exp $"; +static char rcsid[] = "$OpenBSD: tree.c,v 1.13 2005/11/28 03:12:52 cloder Exp $"; #endif #include <stdlib.h> @@ -155,7 +155,7 @@ initmtab(void) "||" } }, { QUEST, { 1,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0, "?" } }, - { COLON, { 1,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0, + { COLON, { 1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0, ":" } }, { ASSIGN, { 1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0, "=" } }, |