Module Name:    src
Committed By:   rillig
Date:           Sat Jul  8 12:07:21 UTC 2023

Modified Files:
        src/usr.bin/xlint/lint1: debug.c tree.c

Log Message:
lint: clean up

PUSH nodes are not marked as binary, yet they have a left and a right
operand.

If none of the queries is enabled, omit the query from the debug log.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/usr.bin/xlint/lint1/debug.c
cvs rdiff -u -r1.550 -r1.551 src/usr.bin/xlint/lint1/tree.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/xlint/lint1/debug.c
diff -u src/usr.bin/xlint/lint1/debug.c:1.46 src/usr.bin/xlint/lint1/debug.c:1.47
--- src/usr.bin/xlint/lint1/debug.c:1.46	Sun Jul  2 18:28:15 2023
+++ src/usr.bin/xlint/lint1/debug.c	Sat Jul  8 12:07:21 2023
@@ -1,4 +1,4 @@
-/* $NetBSD: debug.c,v 1.46 2023/07/02 18:28:15 rillig Exp $ */
+/* $NetBSD: debug.c,v 1.47 2023/07/08 12:07:21 rillig Exp $ */
 
 /*-
  * Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID)
-__RCSID("$NetBSD: debug.c,v 1.46 2023/07/02 18:28:15 rillig Exp $");
+__RCSID("$NetBSD: debug.c,v 1.47 2023/07/08 12:07:21 rillig Exp $");
 #endif
 
 #include <stdlib.h>
@@ -227,7 +227,8 @@ debug_node(const tnode_t *tn) // NOLINT(
 		lint_assert(tn->tn_left != NULL);
 		debug_node(tn->tn_left);
 		if (op != INCBEF && op != INCAFT
-		    && op != DECBEF && op != DECAFT)
+		    && op != DECBEF && op != DECAFT
+		    && op != PUSH)
 			lint_assert(is_binary(tn) == (tn->tn_right != NULL));
 		if (tn->tn_right != NULL)
 			debug_node(tn->tn_right);

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.550 src/usr.bin/xlint/lint1/tree.c:1.551
--- src/usr.bin/xlint/lint1/tree.c:1.550	Sat Jul  8 09:35:35 2023
+++ src/usr.bin/xlint/lint1/tree.c	Sat Jul  8 12:07:21 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.550 2023/07/08 09:35:35 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.551 2023/07/08 12:07:21 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID)
-__RCSID("$NetBSD: tree.c,v 1.550 2023/07/08 09:35:35 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.551 2023/07/08 12:07:21 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -3465,7 +3465,7 @@ convert_integer_from_integer(op_t op, in
 		}
 	}
 
-	if (is_uinteger(nt) != is_uinteger(ot))
+	if (any_query_enabled && is_uinteger(nt) != is_uinteger(ot))
 		/* implicit conversion changes sign from '%s' to '%s' */
 		query_message(3, type_name(tn->tn_type), type_name(tp));
 }

Reply via email to