Source-Changes-HG archive

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

[src/trunk]: src/usr.bin usr.bin: enable lint checks for most programs in /us...



details:   https://anonhg.NetBSD.org/src/rev/34a397f43792
branches:  trunk
changeset: 985408:34a397f43792
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Aug 22 22:24:11 2021 +0000

description:
usr.bin: enable lint checks for most programs in /usr/bin

Previously, lint was only activated for the libraries, but not for the
kernel or userland programs.  Activate lint for the programs in /usr/bin
for now, more will follow later.

This only affects builds that set MKLINT=yes.

diffstat:

 usr.bin/Makefile.inc         |   7 ++++++-
 usr.bin/kdump/Makefile       |   3 ++-
 usr.bin/ktruss/Makefile      |   3 ++-
 usr.bin/rump_server/Makefile |   3 ++-
 usr.bin/vmstat/vmstat.c      |  22 ++++++++++++++--------
 usr.bin/xlint/lint1/Makefile |   3 ++-
 6 files changed, 28 insertions(+), 13 deletions(-)

diffs (140 lines):

diff -r 7ddf58e4090c -r 34a397f43792 usr.bin/Makefile.inc
--- a/usr.bin/Makefile.inc      Sun Aug 22 22:15:07 2021 +0000
+++ b/usr.bin/Makefile.inc      Sun Aug 22 22:24:11 2021 +0000
@@ -1,5 +1,10 @@
-#      $NetBSD: Makefile.inc,v 1.10 2012/03/21 05:47:53 matt Exp $
+#      $NetBSD: Makefile.inc,v 1.11 2021/08/22 22:24:11 rillig Exp $
 #      from: @(#)Makefile.inc  8.1 (Berkeley) 6/6/93
 
 WARNS?=        5
 BINDIR?=/usr/bin
+
+.include <bsd.own.mk>
+.if ${MKLINT} != "no" && ${LINT_SUPPORTED:Uyes} == "yes"
+realall: lint
+.endif
diff -r 7ddf58e4090c -r 34a397f43792 usr.bin/kdump/Makefile
--- a/usr.bin/kdump/Makefile    Sun Aug 22 22:15:07 2021 +0000
+++ b/usr.bin/kdump/Makefile    Sun Aug 22 22:24:11 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.34 2020/09/07 00:26:23 mrg Exp $
+#      $NetBSD: Makefile,v 1.35 2021/08/22 22:24:12 rillig Exp $
 #      @(#)Makefile    8.1 (Berkeley) 6/6/93
 
 .include <bsd.own.mk>          # for MKDYNAMICROOT & NETBSDSRCDIR
@@ -11,6 +11,7 @@
 SRCS=  kdump.c subr.c setemul.c siginfo.c
 .PATH: ${NETBSDSRCDIR}/usr.bin/ktrace
 CLEANFILES+=siginfo.c
+LINT_SUPPORTED=        no      # kdump-ioctl.c defines uio_t twice.
 
 .if (${MKDYNAMICROOT} == "no")
 LDSTATIC?=-static
diff -r 7ddf58e4090c -r 34a397f43792 usr.bin/ktruss/Makefile
--- a/usr.bin/ktruss/Makefile   Sun Aug 22 22:15:07 2021 +0000
+++ b/usr.bin/ktruss/Makefile   Sun Aug 22 22:24:11 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.31 2020/09/07 00:26:23 mrg Exp $
+#      $NetBSD: Makefile,v 1.32 2021/08/22 22:24:12 rillig Exp $
 
 NOMAN=         # defined
 
@@ -7,6 +7,7 @@
 PROG=          ktruss
 SRCS=          ktrace.c dump.c subr.c misc.c setemul.c
 CLEANFILES+=   misc.c misc.h
+LINT_SUPPORTED=        no      # ktruss-ioctl.c defines uio_t twice.
 
 .if (${MKDYNAMICROOT} == "no")
 LDSTATIC?=-static
diff -r 7ddf58e4090c -r 34a397f43792 usr.bin/rump_server/Makefile
--- a/usr.bin/rump_server/Makefile      Sun Aug 22 22:15:07 2021 +0000
+++ b/usr.bin/rump_server/Makefile      Sun Aug 22 22:24:11 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.15 2021/07/07 11:51:46 martin Exp $
+#      $NetBSD: Makefile,v 1.16 2021/08/22 22:24:12 rillig Exp $
 #
 
 .PATH: ${.CURDIR}/../rump_allserver
@@ -6,6 +6,7 @@
 PROG=          rump_server
 SRCS=          rump_allserver.c
 NOMAN=         installed by ../rump_allserver
+LINT_SUPPORTED=        no      # LDADD contains -Wl,...
 
 LDADD+= \
     -Wl,--whole-archive \
diff -r 7ddf58e4090c -r 34a397f43792 usr.bin/vmstat/vmstat.c
--- a/usr.bin/vmstat/vmstat.c   Sun Aug 22 22:15:07 2021 +0000
+++ b/usr.bin/vmstat/vmstat.c   Sun Aug 22 22:24:11 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.246 2021/04/02 06:28:55 simonb Exp $ */
+/* $NetBSD: vmstat.c,v 1.247 2021/08/22 22:24:12 rillig Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000, 2001, 2007, 2019, 2020
@@ -71,7 +71,7 @@
 #if 0
 static char sccsid[] = "@(#)vmstat.c   8.2 (Berkeley) 3/1/95";
 #else
-__RCSID("$NetBSD: vmstat.c,v 1.246 2021/04/02 06:28:55 simonb Exp $");
+__RCSID("$NetBSD: vmstat.c,v 1.247 2021/08/22 22:24:12 rillig Exp $");
 #endif
 #endif /* not lint */
 
@@ -1568,8 +1568,10 @@
        struct pool_allocator pa;
        char maxp[32], name[32];
 
-       if (memf == NULL)
-               return dopool_sysctl(verbose, wide);
+       if (memf == NULL) {
+               dopool_sysctl(verbose, wide);
+               return;
+       }
 
        memset(&pool_totals, 0, sizeof pool_totals);
        kread(namelist, X_POOLHEAD, &pool_head, sizeof(pool_head));
@@ -1767,8 +1769,10 @@
        size_t i;
        double p;
 
-       if (memf == NULL)
-               return dopoolcache_sysctl(verbose);
+       if (memf == NULL) {
+               dopoolcache_sysctl(verbose);
+               return;
+       }
 
        kread(namelist, X_POOLHEAD, &pool_head, sizeof(pool_head));
        addr = TAILQ_FIRST(&pool_head);
@@ -1895,8 +1899,10 @@
        u_long  hashsize, i;
        int     used, items, chain, maxchain;
 
-       if (memf == NULL)
-               return dohashstat_sysctl(verbose, todo, hashname);
+       if (memf == NULL) {
+               dohashstat_sysctl(verbose, todo, hashname);
+               return;
+       }
 
        hashbuf = NULL;
        hashbufsize = 0;
diff -r 7ddf58e4090c -r 34a397f43792 usr.bin/xlint/lint1/Makefile
--- a/usr.bin/xlint/lint1/Makefile      Sun Aug 22 22:15:07 2021 +0000
+++ b/usr.bin/xlint/lint1/Makefile      Sun Aug 22 22:24:11 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.83 2021/08/07 17:38:41 rillig Exp $
+#      $NetBSD: Makefile,v 1.84 2021/08/22 22:24:12 rillig Exp $
 
 .include <bsd.own.mk>
 
@@ -19,6 +19,7 @@
 LINTFLAGS+=            -T
 LOBJS.${PROG}+=                ${SRCS:M*.y:.y=.ln}
 LOBJS.${PROG}+=                ${SRCS:M*.l:.l=.ln}
+LINTFLAGS.scan.c+=     -X 107,126,330,331,332,333      # strict bool mode
 
 CPPFLAGS+=     -DIS_LINT1
 CPPFLAGS+=     -I${.CURDIR}



Home | Main Index | Thread Index | Old Index