Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/xlint lint: enable more lint warnings for its own so...



details:   https://anonhg.NetBSD.org/src/rev/4583225a2388
branches:  trunk
changeset: 377348:4583225a2388
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Jul 08 11:18:16 2023 +0000

description:
lint: enable more lint warnings for its own source code

diffstat:

 usr.bin/xlint/Makefile.inc   |  5 ++++-
 usr.bin/xlint/lint1/Makefile |  3 +--
 usr.bin/xlint/lint2/read.c   |  8 ++++----
 3 files changed, 9 insertions(+), 7 deletions(-)

diffs (70 lines):

diff -r c6c1ce3efc6b -r 4583225a2388 usr.bin/xlint/Makefile.inc
--- a/usr.bin/xlint/Makefile.inc        Sat Jul 08 11:03:00 2023 +0000
+++ b/usr.bin/xlint/Makefile.inc        Sat Jul 08 11:18:16 2023 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.23 2022/04/10 13:21:34 martin Exp $
+#      $NetBSD: Makefile.inc,v 1.24 2023/07/08 11:18:16 rillig Exp $
 
 .include <bsd.own.mk>
 
@@ -27,4 +27,7 @@ CFLAGS+=      ${ACTIVE_CC:Mgcc:%=-ftrapv}
 .include "${.CURDIR}/../../Makefile.inc"
 .endif
 
+LINTFLAGS+=    -aa     # warn about all lossy conversions
+LINTFLAGS+=    -e      # strict enum mode
+LINTFLAGS+=    -T      # strict bool mode
 LINTFLAGS+=    -w      # treat warnings as errors
diff -r c6c1ce3efc6b -r 4583225a2388 usr.bin/xlint/lint1/Makefile
--- a/usr.bin/xlint/lint1/Makefile      Sat Jul 08 11:03:00 2023 +0000
+++ b/usr.bin/xlint/lint1/Makefile      Sat Jul 08 11:18:16 2023 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.96 2023/07/05 11:42:14 rillig Exp $
+#      $NetBSD: Makefile,v 1.97 2023/07/08 11:18:16 rillig Exp $
 
 .include <bsd.own.mk>
 
@@ -16,7 +16,6 @@ YHEADER=
 #LFLAGS+=      -d
 
 CWARNFLAGS.clang+=     -Wno-error=implicit-int-float-conversion
-LINTFLAGS+=            -T
 LOBJS.${PROG}+=                ${SRCS:M*.y:.y=.ln}
 LOBJS.${PROG}+=                ${SRCS:M*.l:.l=.ln}
 LINTFLAGS.cgram.c+=    -X 351          # 'extern' declaration in .c file
diff -r c6c1ce3efc6b -r 4583225a2388 usr.bin/xlint/lint2/read.c
--- a/usr.bin/xlint/lint2/read.c        Sat Jul 08 11:03:00 2023 +0000
+++ b/usr.bin/xlint/lint2/read.c        Sat Jul 08 11:18:16 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: read.c,v 1.82 2023/07/03 07:03:19 rillig Exp $ */
+/* $NetBSD: read.c,v 1.83 2023/07/08 11:18:16 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID)
-__RCSID("$NetBSD: read.c,v 1.82 2023/07/03 07:03:19 rillig Exp $");
+__RCSID("$NetBSD: read.c,v 1.83 2023/07/08 11:18:16 rillig Exp $");
 #endif
 
 #include <ctype.h>
@@ -732,7 +732,7 @@ inptype(const char *cp, const char **epp
                        tp->t_uniqpos.p_line = parse_int(&cp);
                        cp++;
                        /* xlate to 'global' file name. */
-                       tp->t_uniqpos.p_file =
+                       tp->t_uniqpos.p_file = (short)
                            addoutfile(inpfns[parse_int(&cp)]);
                        cp++;
                        tp->t_uniqpos.p_uniq = parse_int(&cp);
@@ -973,7 +973,7 @@ storetyp(type_t *tp, const char *cp, siz
 
        thte = xalloc(sizeof(*thte));
        thte->th_name = name;
-       thte->th_idx = tidx;
+       thte->th_idx = (unsigned short)tidx;
        thte->th_next = thtab[h];
        thtab[h] = thte;
 



Home | Main Index | Thread Index | Old Index