lint: enable more lint warnings for its own source code

This commit is contained in:
rillig 2023-07-08 11:18:16 +00:00
parent 1d1794a80f
commit 8668fe51f9
3 changed files with 9 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -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, size_t len, int h)
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;