Module Name: src
Committed By: rillig
Date: Sat Jun 15 19:43:56 UTC 2024
Modified Files:
src/usr.bin/make: parse.c
src/usr.bin/make/unit-tests: varmod-match-escape.exp
varmod-match-escape.mk varmod-match.exp varmod-match.mk
Log Message:
make: in warnings, move the word "warning" to the front
To generate a diff of this commit:
cvs rdiff -u -r1.730 -r1.731 src/usr.bin/make/parse.c
cvs rdiff -u -r1.19 -r1.20 \
src/usr.bin/make/unit-tests/varmod-match-escape.exp
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/make/unit-tests/varmod-match-escape.mk
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/make/unit-tests/varmod-match.exp
cvs rdiff -u -r1.23 -r1.24 src/usr.bin/make/unit-tests/varmod-match.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/parse.c
diff -u src/usr.bin/make/parse.c:1.730 src/usr.bin/make/parse.c:1.731
--- src/usr.bin/make/parse.c:1.730 Sun Jun 2 15:31:26 2024
+++ src/usr.bin/make/parse.c Sat Jun 15 19:43:56 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.730 2024/06/02 15:31:26 rillig Exp $ */
+/* $NetBSD: parse.c,v 1.731 2024/06/15 19:43:56 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -105,7 +105,7 @@
#include "pathnames.h"
/* "@(#)parse.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.730 2024/06/02 15:31:26 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.731 2024/06/15 19:43:56 rillig Exp $");
/* Detects a multiple-inclusion guard in a makefile. */
typedef enum {
@@ -521,9 +521,9 @@ ParseVErrorInternal(FILE *f, bool useVar
(void)fprintf(f, "%s: ", progname);
PrintLocation(f, useVars, gn);
- fprintf(f, "%s", EvalStack_Details());
if (level == PARSE_WARNING)
(void)fprintf(f, "warning: ");
+ fprintf(f, "%s", EvalStack_Details());
(void)vfprintf(f, fmt, ap);
(void)fprintf(f, "\n");
(void)fflush(f);
Index: src/usr.bin/make/unit-tests/varmod-match-escape.exp
diff -u src/usr.bin/make/unit-tests/varmod-match-escape.exp:1.19 src/usr.bin/make/unit-tests/varmod-match-escape.exp:1.20
--- src/usr.bin/make/unit-tests/varmod-match-escape.exp:1.19 Sat Apr 20 10:18:55 2024
+++ src/usr.bin/make/unit-tests/varmod-match-escape.exp Sat Jun 15 19:43:56 2024
@@ -34,8 +34,8 @@ make: "varmod-match-escape.mk" line 43:
Global: .MAKEFLAGS = -r -k -d cv -d
Global: .MAKEFLAGS = -r -k -d cv -d 0
make: "varmod-match-escape.mk" line 69: while evaluating "${:U\$:M\$} != """: Dollar followed by nothing
-make: "varmod-match-escape.mk" line 110: while evaluating variable "WORDS": warning: Unfinished character list in pattern '[A-]' of modifier ':M'
-make: "varmod-match-escape.mk" line 110: while evaluating variable "WORDS": warning: Unfinished character list in pattern '[^A-]' of modifier ':M'
+make: "varmod-match-escape.mk" line 110: warning: while evaluating variable "WORDS": Unfinished character list in pattern '[A-]' of modifier ':M'
+make: "varmod-match-escape.mk" line 110: warning: while evaluating variable "WORDS": Unfinished character list in pattern '[^A-]' of modifier ':M'
make: Fatal errors encountered -- cannot continue
make: stopped in unit-tests
exit status 1
Index: src/usr.bin/make/unit-tests/varmod-match-escape.mk
diff -u src/usr.bin/make/unit-tests/varmod-match-escape.mk:1.13 src/usr.bin/make/unit-tests/varmod-match-escape.mk:1.14
--- src/usr.bin/make/unit-tests/varmod-match-escape.mk:1.13 Sat Apr 20 10:18:55 2024
+++ src/usr.bin/make/unit-tests/varmod-match-escape.mk Sat Jun 15 19:43:56 2024
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-match-escape.mk,v 1.13 2024/04/20 10:18:55 rillig Exp $
+# $NetBSD: varmod-match-escape.mk,v 1.14 2024/06/15 19:43:56 rillig Exp $
#
# As of 2020-08-01, the :M and :N modifiers interpret backslashes differently,
# depending on whether there was an expression somewhere before the
@@ -105,8 +105,8 @@ EXP.[^A-]]= a
EXP.[^A-]]]= a]
.for pattern in [A-] [A-]] [A-]]] [^A-] [^A-]] [^A-]]]
-# expect+2: while evaluating variable "WORDS": warning: Unfinished character list in pattern '[A-]' of modifier ':M'
-# expect+1: while evaluating variable "WORDS": warning: Unfinished character list in pattern '[^A-]' of modifier ':M'
+# expect+2: warning: while evaluating variable "WORDS": Unfinished character list in pattern '[A-]' of modifier ':M'
+# expect+1: warning: while evaluating variable "WORDS": Unfinished character list in pattern '[^A-]' of modifier ':M'
. if ${WORDS:M${pattern}} != ${EXP.${pattern}}
. warning ${pattern}: ${WORDS:M${pattern}} != ${EXP.${pattern}}
. endif
Index: src/usr.bin/make/unit-tests/varmod-match.exp
diff -u src/usr.bin/make/unit-tests/varmod-match.exp:1.17 src/usr.bin/make/unit-tests/varmod-match.exp:1.18
--- src/usr.bin/make/unit-tests/varmod-match.exp:1.17 Wed Jun 5 22:06:53 2024
+++ src/usr.bin/make/unit-tests/varmod-match.exp Sat Jun 15 19:43:56 2024
@@ -1,12 +1,12 @@
-make: "varmod-match.mk" line 289: while evaluating variable "WORDS": warning: Unfinished character list in pattern 'a[' of modifier ':M'
-make: "varmod-match.mk" line 297: while evaluating variable "WORDS": warning: Unfinished character list in pattern 'a[^' of modifier ':M'
-make: "varmod-match.mk" line 305: while evaluating variable "WORDS": warning: Unfinished character list in pattern '[-x1-3' of modifier ':M'
-make: "varmod-match.mk" line 313: while evaluating variable "WORDS": warning: Unfinished character list in pattern '*[-x1-3' of modifier ':M'
-make: "varmod-match.mk" line 322: while evaluating variable "WORDS": warning: Unfinished character list in pattern '[^-x1-3' of modifier ':M'
-make: "varmod-match.mk" line 336: while evaluating variable "WORDS": warning: Unfinished character list in pattern '?[\' of modifier ':M'
-make: "varmod-match.mk" line 344: while evaluating variable "WORDS": warning: Unfinished character range in pattern '[x-' of modifier ':M'
-make: "varmod-match.mk" line 356: while evaluating variable "WORDS": warning: Unfinished character range in pattern '[^x-' of modifier ':M'
-make: "varmod-match.mk" line 364: while evaluating variable " : :: ": warning: Unfinished character list in pattern '[' of modifier ':M'
+make: "varmod-match.mk" line 289: warning: while evaluating variable "WORDS": Unfinished character list in pattern 'a[' of modifier ':M'
+make: "varmod-match.mk" line 297: warning: while evaluating variable "WORDS": Unfinished character list in pattern 'a[^' of modifier ':M'
+make: "varmod-match.mk" line 305: warning: while evaluating variable "WORDS": Unfinished character list in pattern '[-x1-3' of modifier ':M'
+make: "varmod-match.mk" line 313: warning: while evaluating variable "WORDS": Unfinished character list in pattern '*[-x1-3' of modifier ':M'
+make: "varmod-match.mk" line 322: warning: while evaluating variable "WORDS": Unfinished character list in pattern '[^-x1-3' of modifier ':M'
+make: "varmod-match.mk" line 336: warning: while evaluating variable "WORDS": Unfinished character list in pattern '?[\' of modifier ':M'
+make: "varmod-match.mk" line 344: warning: while evaluating variable "WORDS": Unfinished character range in pattern '[x-' of modifier ':M'
+make: "varmod-match.mk" line 356: warning: while evaluating variable "WORDS": Unfinished character range in pattern '[^x-' of modifier ':M'
+make: "varmod-match.mk" line 364: warning: while evaluating variable " : :: ": Unfinished character list in pattern '[' of modifier ':M'
make: "varmod-match.mk" line 364: while evaluating variable " : :: ": Unknown modifier "]"
make: "varmod-match.mk" line 364: Malformed conditional (${ ${:U\:} ${:U\:\:} :L:M[:]} != ":")
make: Fatal errors encountered -- cannot continue
Index: src/usr.bin/make/unit-tests/varmod-match.mk
diff -u src/usr.bin/make/unit-tests/varmod-match.mk:1.23 src/usr.bin/make/unit-tests/varmod-match.mk:1.24
--- src/usr.bin/make/unit-tests/varmod-match.mk:1.23 Wed Jun 5 22:06:53 2024
+++ src/usr.bin/make/unit-tests/varmod-match.mk Sat Jun 15 19:43:56 2024
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-match.mk,v 1.23 2024/06/05 22:06:53 rillig Exp $
+# $NetBSD: varmod-match.mk,v 1.24 2024/06/15 19:43:56 rillig Exp $
#
# Tests for the ':M' modifier, which keeps only those words that match the
# given pattern.
@@ -285,7 +285,7 @@ ${:U*}= asterisk
# [ Incomplete empty character list, never matches.
WORDS= a a[
-# expect+1: while evaluating variable "WORDS": warning: Unfinished character list in pattern 'a[' of modifier ':M'
+# expect+1: warning: while evaluating variable "WORDS": Unfinished character list in pattern 'a[' of modifier ':M'
.if ${WORDS:Ma[} != ""
. error
.endif
@@ -293,7 +293,7 @@ WORDS= a a[
# [^ Incomplete negated empty character list, matches any single
# character.
WORDS= a a[ aX
-# expect+1: while evaluating variable "WORDS": warning: Unfinished character list in pattern 'a[^' of modifier ':M'
+# expect+1: warning: while evaluating variable "WORDS": Unfinished character list in pattern 'a[^' of modifier ':M'
.if ${WORDS:Ma[^} != "a[ aX"
. error
.endif
@@ -301,7 +301,7 @@ WORDS= a a[ aX
# [-x1-3 Incomplete character list, matches those elements that can be
# parsed without lookahead.
WORDS= - + x xx 0 1 2 3 4 [x1-3
-# expect+1: while evaluating variable "WORDS": warning: Unfinished character list in pattern '[-x1-3' of modifier ':M'
+# expect+1: warning: while evaluating variable "WORDS": Unfinished character list in pattern '[-x1-3' of modifier ':M'
.if ${WORDS:M[-x1-3} != "- x 1 2 3"
. error
.endif
@@ -309,7 +309,7 @@ WORDS= - + x xx 0 1 2 3 4 [x1-3
# *[-x1-3 Incomplete character list after a wildcard, matches those
# words that end with one of the characters from the list.
WORDS= - + x xx 0 1 2 3 4 00 01 10 11 000 001 010 011 100 101 110 111 [x1-3
-# expect+1: while evaluating variable "WORDS": warning: Unfinished character list in pattern '*[-x1-3' of modifier ':M'
+# expect+1: warning: while evaluating variable "WORDS": Unfinished character list in pattern '*[-x1-3' of modifier ':M'
.if ${WORDS:M*[-x1-3} != "- x xx 1 2 3 01 11 001 011 101 111 [x1-3"
. warning ${WORDS:M*[-x1-3}
.endif
@@ -318,7 +318,7 @@ WORDS= - + x xx 0 1 2 3 4 00 01 10 11 0
# Incomplete negated character list, matches any character
# except those elements that can be parsed without lookahead.
WORDS= - + x xx 0 1 2 3 4 [x1-3
-# expect+1: while evaluating variable "WORDS": warning: Unfinished character list in pattern '[^-x1-3' of modifier ':M'
+# expect+1: warning: while evaluating variable "WORDS": Unfinished character list in pattern '[^-x1-3' of modifier ':M'
.if ${WORDS:M[^-x1-3} != "+ 0 4"
. error
.endif
@@ -332,7 +332,7 @@ WORDS= - + x xx 0 1 2 3 4 [x1-3
# '\', as there is no following space that could be escaped.
WORDS= \\ \a ${:Ux\\}
PATTERN= ${:U?[\\}
-# expect+1: while evaluating variable "WORDS": warning: Unfinished character list in pattern '?[\' of modifier ':M'
+# expect+1: warning: while evaluating variable "WORDS": Unfinished character list in pattern '?[\' of modifier ':M'
.if ${WORDS:M${PATTERN}} != "\\\\ x\\"
. error
.endif
@@ -340,7 +340,7 @@ PATTERN= ${:U?[\\}
# [x- Incomplete character list containing an incomplete character
# range, matches only the 'x'.
WORDS= [x- x x- y
-# expect+1: while evaluating variable "WORDS": warning: Unfinished character range in pattern '[x-' of modifier ':M'
+# expect+1: warning: while evaluating variable "WORDS": Unfinished character range in pattern '[x-' of modifier ':M'
.if ${WORDS:M[x-} != "x"
. error
.endif
@@ -352,13 +352,13 @@ WORDS= [x- x x- y
# XXX: Even matches strings that are longer than a single
# character.
WORDS= [x- x x- y yyyyy
-# expect+1: while evaluating variable "WORDS": warning: Unfinished character range in pattern '[^x-' of modifier ':M'
+# expect+1: warning: while evaluating variable "WORDS": Unfinished character range in pattern '[^x-' of modifier ':M'
.if ${WORDS:M[^x-} != "[x- y yyyyy"
. error
.endif
# [:] matches never since the ':' starts the next modifier
-# expect+3: while evaluating variable " : :: ": warning: Unfinished character list in pattern '[' of modifier ':M'
+# expect+3: warning: while evaluating variable " : :: ": Unfinished character list in pattern '[' of modifier ':M'
# expect+2: while evaluating variable " : :: ": Unknown modifier "]"
# expect+1: Malformed conditional (${ ${:U\:} ${:U\:\:} :L:M[:]} != ":")
.if ${ ${:U\:} ${:U\:\:} :L:M[:]} != ":"