Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xlint/lint1 lint: add debug logging for reachability



details:   https://anonhg.NetBSD.org/src/rev/bbfdcf1366ed
branches:  trunk
changeset: 961437:bbfdcf1366ed
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Apr 19 13:18:43 2021 +0000

description:
lint: add debug logging for reachability

diffstat:

 usr.bin/xlint/lint1/func.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r 784b30507aa8 -r bbfdcf1366ed usr.bin/xlint/lint1/func.c
--- a/usr.bin/xlint/lint1/func.c        Mon Apr 19 08:40:15 2021 +0000
+++ b/usr.bin/xlint/lint1/func.c        Mon Apr 19 13:18:43 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: func.c,v 1.105 2021/04/18 17:36:18 rillig Exp $        */
+/*     $NetBSD: func.c,v 1.106 2021/04/19 13:18:43 rillig Exp $        */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: func.c,v 1.105 2021/04/18 17:36:18 rillig Exp $");
+__RCSID("$NetBSD: func.c,v 1.106 2021/04/19 13:18:43 rillig Exp $");
 #endif
 
 #include <stdlib.h>
@@ -190,6 +190,11 @@
 static void
 set_reached(bool new_reached)
 {
+#ifdef DEBUG
+       printf("%s:%d: %s -> %s\n", curr_pos.p_file, curr_pos.p_line,
+           reached ? "reachable" : "unreachable",
+           new_reached ? "reachable" : "unreachable");
+#endif
        reached = new_reached;
        warn_about_unreachable = true;
 }



Home | Main Index | Thread Index | Old Index