summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2006-04-27 20:37:34 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2006-04-27 20:37:34 +0000
commit9dae24630c14cb491621cb89d7aab37144afa775 (patch)
tree2e3144ef93dd69fa26ba090e2c9193497e68ef07
parentb2d06a72540c0aac40d8906c1ee9a42a7adc8063 (diff)
Correctly process comma operator when hunting for "expression has null
effect" warnings. NetBSD has same fix, I found out after the fact. ok cloder@
-rw-r--r--usr.bin/xlint/lint1/tree.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/xlint/lint1/tree.c b/usr.bin/xlint/lint1/tree.c
index 15862a3766d..963c3847029 100644
--- a/usr.bin/xlint/lint1/tree.c
+++ b/usr.bin/xlint/lint1/tree.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tree.c,v 1.36 2006/04/25 01:25:41 cloder Exp $ */
+/* $OpenBSD: tree.c,v 1.37 2006/04/27 20:37:33 otto 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.36 2006/04/25 01:25:41 cloder Exp $";
+static char rcsid[] = "$OpenBSD: tree.c,v 1.37 2006/04/27 20:37:33 otto Exp $";
#endif
#include <stdlib.h>
@@ -3405,10 +3405,10 @@ nulleff(tnode_t *tn)
* operands has a side effect
*/
tn = tn->tn_right;
- } else if (tn->tn_op == COLON) {
+ } else if (tn->tn_op == COLON || tn->tn_op == COMMA) {
/*
- * : has a side effect if at least one of its operands
- * has a side effect
+ * : and , have a side effect if at least one of the
+ * operands has a side effect
*/
if (modtab[tn->tn_left->tn_op].m_sideeff) {
tn = tn->tn_left;