Module Name:    src
Committed By:   rillig
Date:           Tue Dec 22 22:31:50 UTC 2020

Modified Files:
        src/usr.bin/make: make.h meta.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.235 -r1.236 src/usr.bin/make/make.h
cvs rdiff -u -r1.164 -r1.165 src/usr.bin/make/meta.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/make/make.h
diff -u src/usr.bin/make/make.h:1.235 src/usr.bin/make/make.h:1.236
--- src/usr.bin/make/make.h:1.235	Fri Dec 18 18:17:45 2020
+++ src/usr.bin/make/make.h	Tue Dec 22 22:31:50 2020
@@ -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 @@ typedef enum DebugFlags {
 
 #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);
 

Index: src/usr.bin/make/meta.c
diff -u src/usr.bin/make/meta.c:1.164 src/usr.bin/make/meta.c:1.165
--- src/usr.bin/make/meta.c:1.164	Sun Dec 20 22:36:40 2020
+++ src/usr.bin/make/meta.c	Tue Dec 22 22:31:50 2020
@@ -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 @@ meta_needed(GNode *gn, const char *dname
     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. */

Reply via email to