Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make make(1): fix return type of macro DEBUG



details:   https://anonhg.NetBSD.org/src/rev/432421c59443
branches:  trunk
changeset: 958075:432421c59443
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Dec 22 22:31:50 2020 +0000

description:
make(1): fix return type of macro DEBUG

This macro was supposed to return a boolean expression all the time, it
just hadn't been implemented this way.  This resulted in wrong output
for the test sh-flags, in compilation modes -DUSE_UCHAR_BOOLEAN and
-DUSE_CHAR_BOOLEAN, since in ParseCommandFlags, the expression
DEBUG(LOUD) didn't fit into a boolean.

diffstat:

 usr.bin/make/make.h |  4 ++--
 usr.bin/make/meta.c |  4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r dd1017ce5a3b -r 432421c59443 usr.bin/make/make.h
--- a/usr.bin/make/make.h       Tue Dec 22 20:10:21 2020 +0000
+++ b/usr.bin/make/make.h       Tue Dec 22 22:31:50 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.h,v 1.235 2020/12/18 18:17:45 rillig Exp $        */
+/*     $NetBSD: make.h,v 1.236 2020/12/22 22:31:50 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -581,7 +581,7 @@
 
 #define CONCAT(a, b) a##b
 
-#define DEBUG(module) (opts.debug & CONCAT(DEBUG_,module))
+#define DEBUG(module) ((opts.debug & CONCAT(DEBUG_, module)) != 0)
 
 void debug_printf(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2);
 
diff -r dd1017ce5a3b -r 432421c59443 usr.bin/make/meta.c
--- a/usr.bin/make/meta.c       Tue Dec 22 20:10:21 2020 +0000
+++ b/usr.bin/make/meta.c       Tue Dec 22 22:31:50 2020 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: meta.c,v 1.164 2020/12/20 22:36:40 rillig Exp $ */
+/*      $NetBSD: meta.c,v 1.165 2020/12/22 22:31:50 rillig Exp $ */
 
 /*
  * Implement 'meta' mode.
@@ -416,7 +416,7 @@
     struct cached_stat cst;
 
     if (verbose)
-       verbose = DEBUG(META) != 0;
+       verbose = DEBUG(META);
 
     /* This may be a phony node which we don't want meta data for... */
     /* Skip .meta for .BEGIN, .END, .ERROR etc as well. */



Home | Main Index | Thread Index | Old Index