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 type of local variable in CondGetS...



details:   https://anonhg.NetBSD.org/src/rev/66ade1668d0d
branches:  trunk
changeset: 974842:66ade1668d0d
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Aug 13 19:30:37 2020 +0000

description:
make(1): fix type of local variable in CondGetString

When the Boolean type from sprite.h is replaced with C99's standard bool
type, the chained assignment leads to the following compile error with
GCC 5:

cond.c:404:5: error: suggest parentheses around assignment used as truth
                     value [-Werror=parentheses]
     *quoted = qt = *condExpr == '"' ? 1 : 0;

Changing the type of qt from int to bool fixes this.

diffstat:

 usr.bin/make/cond.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r 3d4c5b2a12fa -r 66ade1668d0d usr.bin/make/cond.c
--- a/usr.bin/make/cond.c       Thu Aug 13 17:26:43 2020 +0000
+++ b/usr.bin/make/cond.c       Thu Aug 13 19:30:37 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cond.c,v 1.93 2020/08/09 19:51:02 rillig Exp $ */
+/*     $NetBSD: cond.c,v 1.94 2020/08/13 19:30:37 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: cond.c,v 1.93 2020/08/09 19:51:02 rillig Exp $";
+static char rcsid[] = "$NetBSD: cond.c,v 1.94 2020/08/13 19:30:37 rillig Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)cond.c     8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: cond.c,v 1.93 2020/08/09 19:51:02 rillig Exp $");
+__RCSID("$NetBSD: cond.c,v 1.94 2020/08/13 19:30:37 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -395,7 +395,7 @@
     const char *cp;
     const char *str;
     int len;
-    int qt;
+    Boolean qt;
     const char *start;
 
     Buf_Init(&buf, 0);



Home | Main Index | Thread Index | Old Index