Module Name: src
Committed By: rillig
Date: Sun Aug 8 11:56:36 UTC 2021
Modified Files:
src/usr.bin/xlint/lint2: Makefile chk.c read.c
Log Message:
lint: force strict bool mode
No functional change.
To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/usr.bin/xlint/lint2/Makefile
cvs rdiff -u -r1.42 -r1.43 src/usr.bin/xlint/lint2/chk.c
cvs rdiff -u -r1.48 -r1.49 src/usr.bin/xlint/lint2/read.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/xlint/lint2/Makefile
diff -u src/usr.bin/xlint/lint2/Makefile:1.20 src/usr.bin/xlint/lint2/Makefile:1.21
--- src/usr.bin/xlint/lint2/Makefile:1.20 Sun Apr 18 22:51:24 2021
+++ src/usr.bin/xlint/lint2/Makefile Sun Aug 8 11:56:35 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.20 2021/04/18 22:51:24 rillig Exp $
+# $NetBSD: Makefile,v 1.21 2021/08/08 11:56:35 rillig Exp $
NOMAN= # defined
@@ -7,6 +7,7 @@ SRCS= main2.c hash.c read.c mem.c mem2.
inittyp.c tyname.c
BINDIR= /usr/libexec
CPPFLAGS+= -I${.CURDIR}
+LINTFLAGS+= -T # strict bool mode
COPTS.msg.c+= ${${ACTIVE_CC} == "clang":? -Wno-format-nonliteral :}
Index: src/usr.bin/xlint/lint2/chk.c
diff -u src/usr.bin/xlint/lint2/chk.c:1.42 src/usr.bin/xlint/lint2/chk.c:1.43
--- src/usr.bin/xlint/lint2/chk.c:1.42 Fri Apr 2 12:16:50 2021
+++ src/usr.bin/xlint/lint2/chk.c Sun Aug 8 11:56:35 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: chk.c,v 1.42 2021/04/02 12:16:50 rillig Exp $ */
+/* $NetBSD: chk.c,v 1.43 2021/08/08 11:56:35 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: chk.c,v 1.42 2021/04/02 12:16:50 rillig Exp $");
+__RCSID("$NetBSD: chk.c,v 1.43 2021/08/08 11:56:35 rillig Exp $");
#endif
#include <ctype.h>
@@ -1085,9 +1085,9 @@ chkrvu(hte_t *hte, sym_t *def)
* but for now I don't want to be bothered by this warnings
* which are almost always useless.
*/
- if (hflag == 0)
+ if (!hflag)
return;
- if (hflag == 1 && bsearch(hte->h_name, ignorelist,
+ if (hflag && bsearch(hte->h_name, ignorelist,
__arraycount(ignorelist), sizeof(ignorelist[0]),
(int (*)(const void *, const void *))strcmp) != NULL)
return;
@@ -1340,7 +1340,7 @@ eqargs(type_t *tp1, type_t *tp2, bool *d
while (*a1 != NULL && *a2 != NULL) {
- if (eqtype(*a1, *a2, true, false, false, dowarn) == 0)
+ if (!eqtype(*a1, *a2, true, false, false, dowarn))
return false;
a1++;
Index: src/usr.bin/xlint/lint2/read.c
diff -u src/usr.bin/xlint/lint2/read.c:1.48 src/usr.bin/xlint/lint2/read.c:1.49
--- src/usr.bin/xlint/lint2/read.c:1.48 Thu Aug 5 06:54:16 2021
+++ src/usr.bin/xlint/lint2/read.c Sun Aug 8 11:56:35 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: read.c,v 1.48 2021/08/05 06:54:16 rillig Exp $ */
+/* $NetBSD: read.c,v 1.49 2021/08/08 11:56:35 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: read.c,v 1.48 2021/08/05 06:54:16 rillig Exp $");
+__RCSID("$NetBSD: read.c,v 1.49 2021/08/08 11:56:35 rillig Exp $");
#endif
#include <ctype.h>
@@ -402,7 +402,7 @@ decldef(pos_t *posp, const char *cp)
sym.s_def = DECL;
break;
case 'i':
- if (sym.s_inline != NODECL)
+ if (sym.s_inline)
inperr("inline %c", c);
sym.s_inline = true;
break;