From 9d28f87b89992dec90044d2ffb730d163f479f1e Mon Sep 17 00:00:00 2001 From: sjg Date: Mon, 12 Feb 2018 21:38:09 +0000 Subject: [PATCH] Do not treat .info as warning for -W Reported by: lwhsu at FreeBSD.org --- usr.bin/make/make.h | 3 ++- usr.bin/make/parse.c | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/usr.bin/make/make.h b/usr.bin/make/make.h index b7d2eebe44f7..53e1895f216c 100644 --- a/usr.bin/make/make.h +++ b/usr.bin/make/make.h @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.103 2017/07/20 19:29:54 sjg Exp $ */ +/* $NetBSD: make.h,v 1.104 2018/02/12 21:38:09 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -330,6 +330,7 @@ typedef struct GNode { * once the makefile has been parsed. PARSE_WARNING means it can. Passed * as the first argument to Parse_Error. */ +#define PARSE_INFO 3 #define PARSE_WARNING 2 #define PARSE_FATAL 1 diff --git a/usr.bin/make/parse.c b/usr.bin/make/parse.c index 7806a80fb444..4e4529776128 100644 --- a/usr.bin/make/parse.c +++ b/usr.bin/make/parse.c @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.225 2017/04/17 13:29:07 maya Exp $ */ +/* $NetBSD: parse.c,v 1.226 2018/02/12 21:38:09 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: parse.c,v 1.225 2017/04/17 13:29:07 maya Exp $"; +static char rcsid[] = "$NetBSD: parse.c,v 1.226 2018/02/12 21:38:09 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: parse.c,v 1.225 2017/04/17 13:29:07 maya Exp $"); +__RCSID("$NetBSD: parse.c,v 1.226 2018/02/12 21:38:09 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -703,6 +703,8 @@ ParseVErrorInternal(FILE *f, const char *cfname, size_t clineno, int type, (void)vfprintf(f, fmt, ap); (void)fprintf(f, "\n"); (void)fflush(f); + if (type == PARSE_INFO) + return; if (type == PARSE_FATAL || parseWarnFatal) fatals += 1; if (parseWarnFatal && !fatal_warning_error_printed) { @@ -795,7 +797,7 @@ ParseMessage(char *line) switch(*line) { case 'i': - mtype = 0; + mtype = PARSE_INFO; break; case 'w': mtype = PARSE_WARNING;