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): run lint with strict bool mode



details:   https://anonhg.NetBSD.org/src/rev/902b419b4d7b
branches:  trunk
changeset: 959045:902b419b4d7b
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jan 30 16:05:45 2021 +0000

description:
make(1): run lint with strict bool mode

The make code is not supposed to use constructs such as "if (strcmp(s1,
s2))" or "if (p && *p)", instead all boolean expressions have a form
that would be accepted by a C#, Go or Java compiler as well.  This also
ensures that pre-C99 compilers generate equivalent code as C99
compilers, at least regarding boolean expressions.

diffstat:

 usr.bin/make/Makefile |  4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diffs (18 lines):

diff -r e6b377f11eb0 -r 902b419b4d7b usr.bin/make/Makefile
--- a/usr.bin/make/Makefile     Sat Jan 30 15:53:55 2021 +0000
+++ b/usr.bin/make/Makefile     Sat Jan 30 16:05:45 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.111 2020/12/12 16:54:20 rillig Exp $
+#      $NetBSD: Makefile,v 1.112 2021/01/30 16:05:45 rillig Exp $
 #      @(#)Makefile    5.2 (Berkeley) 12/28/90
 
 PROG=  make
@@ -127,6 +127,8 @@
 SUBDIR+=       unit-tests
 .endif
 
+LINTFLAGS+=    -T      # strict bool mode, available since 2021-01-11
+
 ${SRCS:M*.c:.c=.o}: ${HDRS}
 CLEANFILES+=   *.o
 



Home | Main Index | Thread Index | Old Index