lint: remove WARNS=3, falling back to the default WARNS=5

It's strange that GCC does not warn about the nonliteral format strings
in lint1/err.c, lint2/msg.c and lint2/read.c, despite -Wformat=2, but
Clang does.
This commit is contained in:
rillig 2021-04-18 22:51:24 +00:00
parent 4b2703ba02
commit 5bf56b009b
8 changed files with 23 additions and 21 deletions

View File

@ -1,6 +1,4 @@
# $NetBSD: Makefile.inc,v 1.13 2013/01/28 14:25:18 matt Exp $
WARNS?= 3 # XXX: fails -Wsign-compare
# $NetBSD: Makefile.inc,v 1.14 2021/04/18 22:51:24 rillig Exp $
.include <bsd.own.mk>

View File

@ -1,4 +1,4 @@
/* $NetBSD: mem.c,v 1.11 2020/12/29 11:35:11 rillig Exp $ */
/* $NetBSD: mem.c,v 1.12 2021/04/18 22:51:24 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
__RCSID("$NetBSD: mem.c,v 1.11 2020/12/29 11:35:11 rillig Exp $");
__RCSID("$NetBSD: mem.c,v 1.12 2021/04/18 22:51:24 rillig Exp $");
#endif
#include <sys/param.h>
@ -92,7 +92,7 @@ xstrdup(const char *s)
return s2;
}
void
void __attribute__((noreturn))
nomem(void)
{

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.69 2021/04/18 21:53:37 rillig Exp $
# $NetBSD: Makefile,v 1.70 2021/04/18 22:51:24 rillig Exp $
.include <bsd.own.mk>
@ -25,6 +25,8 @@ CPPFLAGS+= -DIS_LINT1
CPPFLAGS+= -I${.CURDIR}
CPPFLAGS+= ${DEBUG:D-DDEBUG}
COPTS.err.c+= ${${ACTIVE_CC} == "clang":? -Wno-format-nonliteral :}
BINDIR= /usr/libexec
CLEANFILES+= ${MAN}

View File

@ -1,4 +1,4 @@
/* $NetBSD: main1.c,v 1.44 2021/04/18 20:15:17 rillig Exp $ */
/* $NetBSD: main1.c,v 1.45 2021/04/18 22:51:24 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
__RCSID("$NetBSD: main1.c,v 1.44 2021/04/18 20:15:17 rillig Exp $");
__RCSID("$NetBSD: main1.c,v 1.45 2021/04/18 22:51:24 rillig Exp $");
#endif
#include <sys/types.h>
@ -290,7 +290,7 @@ main(int argc, char *argv[])
return nerr != 0 ? 1 : 0;
}
static void
static void __attribute__((noreturn))
usage(void)
{
(void)fprintf(stderr,
@ -300,7 +300,7 @@ usage(void)
exit(1);
}
void
void __attribute__((noreturn))
norecover(void)
{
/* cannot recover from previous errors */

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.19 2021/04/10 18:36:27 rillig Exp $
# $NetBSD: Makefile,v 1.20 2021/04/18 22:51:24 rillig Exp $
NOMAN= # defined
@ -8,4 +8,6 @@ SRCS= main2.c hash.c read.c mem.c mem2.c chk.c msg.c emit.c emit2.c \
BINDIR= /usr/libexec
CPPFLAGS+= -I${.CURDIR}
COPTS.msg.c+= ${${ACTIVE_CC} == "clang":? -Wno-format-nonliteral :}
.include <bsd.prog.mk>

View File

@ -1,4 +1,4 @@
/* $NetBSD: main2.c,v 1.16 2021/04/18 20:15:17 rillig Exp $ */
/* $NetBSD: main2.c,v 1.17 2021/04/18 22:51:24 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
__RCSID("$NetBSD: main2.c,v 1.16 2021/04/18 20:15:17 rillig Exp $");
__RCSID("$NetBSD: main2.c,v 1.17 2021/04/18 22:51:24 rillig Exp $");
#endif
#include <stdio.h>
@ -89,7 +89,7 @@ bool Fflag;
*/
const char **libs;
static void usage(void);
static void usage(void) __attribute__((noreturn));
int
main(int argc, char *argv[])

View File

@ -1,4 +1,4 @@
/* $NetBSD: read.c,v 1.44 2021/04/18 21:12:50 rillig Exp $ */
/* $NetBSD: read.c,v 1.45 2021/04/18 22:51:24 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.44 2021/04/18 21:12:50 rillig Exp $");
__RCSID("$NetBSD: read.c,v 1.45 2021/04/18 22:51:24 rillig Exp $");
#endif
#include <ctype.h>
@ -237,7 +237,7 @@ readfile(const char *name)
}
static void
static void __attribute__((format(printf, 3, 4))) __attribute__((noreturn))
inperror(const char *file, size_t line, const char *fmt, ...)
{
va_list ap;

View File

@ -1,4 +1,4 @@
/* $NetBSD: xlint.c,v 1.61 2021/04/14 20:35:31 rillig Exp $ */
/* $NetBSD: xlint.c,v 1.62 2021/04/18 22:51:25 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: xlint.c,v 1.61 2021/04/14 20:35:31 rillig Exp $");
__RCSID("$NetBSD: xlint.c,v 1.62 2021/04/18 22:51:25 rillig Exp $");
#endif
#include <sys/param.h>
@ -306,7 +306,7 @@ appdef(char ***lstp, const char *def)
appstrg(lstp, concat3("-D__", def, "__"));
}
static void
static void __attribute__((noreturn))
usage(void)
{
const char *name;