summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcloder <cloder@openbsd.org>2005-11-28 03:12:52 +0000
committercloder <cloder@openbsd.org>2005-11-28 03:12:52 +0000
commit4096554bf21bc8410dc1fa6deb348f31ead40e95 (patch)
treea4a19996d721daa1c8c5381a431493fda29137f6
parentRemove dammit (diff)
downloadwireguard-openbsd-4096554bf21bc8410dc1fa6deb348f31ead40e95.tar.xz
wireguard-openbsd-4096554bf21bc8410dc1fa6deb348f31ead40e95.zip
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.
-rw-r--r--usr.bin/xlint/lint1/tree.c6
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,
"=" } },