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: define debug_named_member only in ...



details:   https://anonhg.NetBSD.org/src/rev/fce67285f7a2
branches:  trunk
changeset: 952885:fce67285f7a2
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Feb 20 17:24:37 2021 +0000

description:
lint: define debug_named_member only in debug mode

In non-debug mode it was an expensive no-op.

diffstat:

 usr.bin/xlint/lint1/init.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r d5118a9fe5e3 -r fce67285f7a2 usr.bin/xlint/lint1/init.c
--- a/usr.bin/xlint/lint1/init.c        Sat Feb 20 17:12:00 2021 +0000
+++ b/usr.bin/xlint/lint1/init.c        Sat Feb 20 17:24:37 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: init.c,v 1.71 2021/02/20 17:12:00 rillig Exp $ */
+/*     $NetBSD: init.c,v 1.72 2021/02/20 17:24:37 rillig Exp $ */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.71 2021/02/20 17:12:00 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.72 2021/02/20 17:24:37 rillig Exp $");
 #endif
 
 #include <stdlib.h>
@@ -206,6 +206,7 @@
        }
 }
 
+#ifdef DEBUG
 static void
 debug_named_member(void)
 {
@@ -222,6 +223,9 @@
        } while (name != namedmem);
        debug_printf("\n");
 }
+#else
+#define debug_named_member() (void)0
+#endif
 
 /*
  * Initialize the initialisation stack by putting an entry for the variable



Home | Main Index | Thread Index | Old Index