Module Name: src
Committed By: rillig
Date: Fri Jul 5 19:47:22 UTC 2024
Modified Files:
src/usr.bin/make: var.c
src/usr.bin/make/unit-tests: cond-token-string.exp cond-token-string.mk
deptgt.exp deptgt.mk directive-for-errors.exp
directive-for-errors.mk directive-for-escape.exp
directive-for-escape.mk directive-for.exp directive-for.mk
directive-include.exp directive-include.mk moderrs.exp moderrs.mk
var-eval-short.exp var-eval-short.mk vardebug.exp vardebug.mk
varmod-assign.exp varmod-edge.exp varmod-edge.mk varmod-gmtime.exp
varmod-gmtime.mk varmod-ifelse.exp varmod-ifelse.mk
varmod-localtime.exp varmod-localtime.mk varmod-loop-delete.exp
varmod-loop-delete.mk varmod-loop-varname.exp
varmod-loop-varname.mk varmod-match-escape.exp
varmod-match-escape.mk varmod-range.exp varmod-range.mk
varmod-shell.exp varmod-shell.mk varmod-subst-regex.exp
varmod-subst.exp varmod-to-separator.exp varmod-to-separator.mk
varmod.exp varmod.mk varparse-errors.exp varparse-errors.mk
Log Message:
make: in error messages for anonymous variables, log the value
To generate a diff of this commit:
cvs rdiff -u -r1.1131 -r1.1132 src/usr.bin/make/var.c
cvs rdiff -u -r1.13 -r1.14 src/usr.bin/make/unit-tests/cond-token-string.exp \
src/usr.bin/make/unit-tests/directive-include.exp \
src/usr.bin/make/unit-tests/varparse-errors.exp
cvs rdiff -u -r1.10 -r1.11 src/usr.bin/make/unit-tests/cond-token-string.mk \
src/usr.bin/make/unit-tests/vardebug.mk
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/make/unit-tests/deptgt.exp \
src/usr.bin/make/unit-tests/directive-include.mk \
src/usr.bin/make/unit-tests/varmod-range.exp \
src/usr.bin/make/unit-tests/varmod.exp
cvs rdiff -u -r1.17 -r1.18 src/usr.bin/make/unit-tests/deptgt.mk \
src/usr.bin/make/unit-tests/varmod-to-separator.mk \
src/usr.bin/make/unit-tests/varmod.mk
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/directive-for-errors.exp \
src/usr.bin/make/unit-tests/varmod-loop-delete.exp
cvs rdiff -u -r1.11 -r1.12 \
src/usr.bin/make/unit-tests/directive-for-errors.mk
cvs rdiff -u -r1.27 -r1.28 \
src/usr.bin/make/unit-tests/directive-for-escape.exp \
src/usr.bin/make/unit-tests/var-eval-short.exp
cvs rdiff -u -r1.25 -r1.26 \
src/usr.bin/make/unit-tests/directive-for-escape.mk \
src/usr.bin/make/unit-tests/directive-for.mk \
src/usr.bin/make/unit-tests/varmod-assign.exp
cvs rdiff -u -r1.23 -r1.24 src/usr.bin/make/unit-tests/directive-for.exp \
src/usr.bin/make/unit-tests/varmod-gmtime.mk
cvs rdiff -u -r1.40 -r1.41 src/usr.bin/make/unit-tests/moderrs.exp
cvs rdiff -u -r1.37 -r1.38 src/usr.bin/make/unit-tests/moderrs.mk
cvs rdiff -u -r1.12 -r1.13 src/usr.bin/make/unit-tests/var-eval-short.mk \
src/usr.bin/make/unit-tests/varmod-range.mk
cvs rdiff -u -r1.35 -r1.36 src/usr.bin/make/unit-tests/vardebug.exp
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/make/unit-tests/varmod-edge.exp \
src/usr.bin/make/unit-tests/varmod-match-escape.exp
cvs rdiff -u -r1.24 -r1.25 src/usr.bin/make/unit-tests/varmod-edge.mk
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/make/unit-tests/varmod-gmtime.exp
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/make/unit-tests/varmod-ifelse.exp
cvs rdiff -u -r1.30 -r1.31 src/usr.bin/make/unit-tests/varmod-ifelse.mk
cvs rdiff -u -r1.16 -r1.17 src/usr.bin/make/unit-tests/varmod-localtime.exp \
src/usr.bin/make/unit-tests/varmod-localtime.mk \
src/usr.bin/make/unit-tests/varparse-errors.mk
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/make/unit-tests/varmod-loop-delete.mk \
src/usr.bin/make/unit-tests/varmod-subst.exp
cvs rdiff -u -r1.9 -r1.10 src/usr.bin/make/unit-tests/varmod-loop-varname.exp \
src/usr.bin/make/unit-tests/varmod-shell.mk \
src/usr.bin/make/unit-tests/varmod-subst-regex.exp
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/make/unit-tests/varmod-loop-varname.mk
cvs rdiff -u -r1.15 -r1.16 src/usr.bin/make/unit-tests/varmod-match-escape.mk \
src/usr.bin/make/unit-tests/varmod-to-separator.exp
cvs rdiff -u -r1.7 -r1.8 src/usr.bin/make/unit-tests/varmod-shell.exp
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/var.c
diff -u src/usr.bin/make/var.c:1.1131 src/usr.bin/make/var.c:1.1132
--- src/usr.bin/make/var.c:1.1131 Fri Jul 5 18:59:33 2024
+++ src/usr.bin/make/var.c Fri Jul 5 19:47:22 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: var.c,v 1.1131 2024/07/05 18:59:33 rillig Exp $ */
+/* $NetBSD: var.c,v 1.1132 2024/07/05 19:47:22 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -132,7 +132,7 @@
#include "metachar.h"
/* "@(#)var.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.1131 2024/07/05 18:59:33 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.1132 2024/07/05 19:47:22 rillig Exp $");
/*
* Variables are defined using one of the VAR=value assignments. Their
@@ -389,10 +389,12 @@ EvalStack_Details(void)
"while evaluating",
};
EvalStackElement *elem = evalStack.elems + i;
- Buf_AddStr(buf, descr[elem->kind]);
+ EvalStackElementKind kind = elem->kind;
+ Buf_AddStr(buf, descr[kind]);
Buf_AddStr(buf, " \"");
Buf_AddStr(buf, elem->str);
- if (elem->kind == VSK_VARNAME) {
+ if (elem->value != NULL
+ && (kind == VSK_VARNAME || kind == VSK_EXPR)) {
Buf_AddStr(buf, "\" with value \"");
Buf_AddStr(buf, elem->value->str);
}
@@ -4602,7 +4604,7 @@ Var_Parse(const char **pp, GNode *scope,
if (expr.name[0] != '\0')
EvalStack_Push(VSK_VARNAME, expr.name, &expr.value);
else
- EvalStack_Push(VSK_EXPR, start, NULL);
+ EvalStack_Push(VSK_EXPR, start, &expr.value);
/*
* Before applying any modifiers, expand any nested expressions from
Index: src/usr.bin/make/unit-tests/cond-token-string.exp
diff -u src/usr.bin/make/unit-tests/cond-token-string.exp:1.13 src/usr.bin/make/unit-tests/cond-token-string.exp:1.14
--- src/usr.bin/make/unit-tests/cond-token-string.exp:1.13 Thu Jul 4 20:18:40 2024
+++ src/usr.bin/make/unit-tests/cond-token-string.exp Fri Jul 5 19:47:22 2024
@@ -1,4 +1,4 @@
-make: "cond-token-string.mk" line 15: while evaluating "${:Uvalue:Z}"": Unknown modifier "Z"
+make: "cond-token-string.mk" line 15: while evaluating "${:Uvalue:Z}"" with value "value": Unknown modifier "Z"
make: "cond-token-string.mk" line 15: Malformed conditional ("" != "${:Uvalue:Z}")
make: "cond-token-string.mk" line 25: xvalue is not defined.
make: "cond-token-string.mk" line 32: Malformed conditional (x${:Uvalue} == "")
Index: src/usr.bin/make/unit-tests/directive-include.exp
diff -u src/usr.bin/make/unit-tests/directive-include.exp:1.13 src/usr.bin/make/unit-tests/directive-include.exp:1.14
--- src/usr.bin/make/unit-tests/directive-include.exp:1.13 Thu Jul 4 20:18:40 2024
+++ src/usr.bin/make/unit-tests/directive-include.exp Fri Jul 5 19:47:22 2024
@@ -4,7 +4,7 @@ CondParser_Eval: ${.MAKE.MAKEFILES:T} !=
Comparing "directive-include.mk null" != "directive-include.mk null"
make: "directive-include.mk" line 26: Could not find nonexistent.mk
make: "directive-include.mk" line 49: Could not find "
-make: "directive-include.mk" line 56: while evaluating "${:U123:Z}.mk": Unknown modifier "Z"
+make: "directive-include.mk" line 56: while evaluating "${:U123:Z}.mk" with value "123": Unknown modifier "Z"
make: "directive-include.mk" line 56: Could not find nonexistent.mk
make: "directive-include.mk" line 61: Cannot open /nonexistent
make: "directive-include.mk" line 66: Invalid line 'include'
Index: src/usr.bin/make/unit-tests/varparse-errors.exp
diff -u src/usr.bin/make/unit-tests/varparse-errors.exp:1.13 src/usr.bin/make/unit-tests/varparse-errors.exp:1.14
--- src/usr.bin/make/unit-tests/varparse-errors.exp:1.13 Fri Jul 5 18:59:33 2024
+++ src/usr.bin/make/unit-tests/varparse-errors.exp Fri Jul 5 19:47:22 2024
@@ -1,25 +1,25 @@
-make: "varparse-errors.mk" line 38: while evaluating "${:U:Z}": Unknown modifier "Z"
-make: "varparse-errors.mk" line 47: while evaluating "${:U:Z}post": Unknown modifier "Z"
-make: "varparse-errors.mk" line 75: while evaluating "${:U:OX:U${IND}} ${:U:OX:U${IND}}": Bad modifier ":OX"
+make: "varparse-errors.mk" line 38: while evaluating "${:U:Z}" with value "": Unknown modifier "Z"
+make: "varparse-errors.mk" line 47: while evaluating "${:U:Z}post" with value "": Unknown modifier "Z"
+make: "varparse-errors.mk" line 75: while evaluating "${:U:OX:U${IND}} ${:U:OX:U${IND}}" with value "": Bad modifier ":OX"
make: "varparse-errors.mk" line 75: Undefined variable "${:U:OX"
-make: "varparse-errors.mk" line 75: while evaluating variable "IND" with value "${:OX}": while evaluating "${:OX}": Bad modifier ":OX"
-make: "varparse-errors.mk" line 75: while evaluating "${:U:OX:U${IND}}": Bad modifier ":OX"
+make: "varparse-errors.mk" line 75: while evaluating variable "IND" with value "${:OX}": while evaluating "${:OX}" with value "": Bad modifier ":OX"
+make: "varparse-errors.mk" line 75: while evaluating "${:U:OX:U${IND}}" with value "": Bad modifier ":OX"
make: "varparse-errors.mk" line 75: Undefined variable "${:U:OX"
-make: "varparse-errors.mk" line 75: while evaluating variable "IND" with value "${:OX}": while evaluating "${:OX}": Bad modifier ":OX"
-make: "varparse-errors.mk" line 83: while evaluating "${:U:Q": Unclosed expression, expecting '}' for modifier "Q"
-make: "varparse-errors.mk" line 85: while evaluating "${:U:sh": Unclosed expression, expecting '}' for modifier "sh"
-make: "varparse-errors.mk" line 87: while evaluating "${:U:tA": Unclosed expression, expecting '}' for modifier "tA"
-make: "varparse-errors.mk" line 89: while evaluating "${:U:tsX": Unclosed expression, expecting '}' for modifier "tsX"
-make: "varparse-errors.mk" line 91: while evaluating "${:U:ts": Unclosed expression, expecting '}' for modifier "ts"
-make: "varparse-errors.mk" line 93: while evaluating "${:U:ts\040": Unclosed expression, expecting '}' for modifier "ts\040"
-make: "varparse-errors.mk" line 95: while evaluating "${:U:u": Unclosed expression, expecting '}' for modifier "u"
-make: "varparse-errors.mk" line 97: while evaluating "${:U:H": Unclosed expression, expecting '}' for modifier "H"
-make: "varparse-errors.mk" line 99: while evaluating "${:U:[1]": Unclosed expression, expecting '}' for modifier "[1]"
-make: "varparse-errors.mk" line 101: while evaluating "${:U:hash": Unclosed expression, expecting '}' for modifier "hash"
-make: "varparse-errors.mk" line 103: while evaluating "${:U:range": Unclosed expression, expecting '}' for modifier "range"
-make: "varparse-errors.mk" line 105: while evaluating "${:U:_": Unclosed expression, expecting '}' for modifier "_"
-make: "varparse-errors.mk" line 107: while evaluating "${:U:gmtime": Unclosed expression, expecting '}' for modifier "gmtime"
-make: "varparse-errors.mk" line 109: while evaluating "${:U:localtime": Unclosed expression, expecting '}' for modifier "localtime"
+make: "varparse-errors.mk" line 75: while evaluating variable "IND" with value "${:OX}": while evaluating "${:OX}" with value "": Bad modifier ":OX"
+make: "varparse-errors.mk" line 83: while evaluating "${:U:Q" with value "": Unclosed expression, expecting '}' for modifier "Q"
+make: "varparse-errors.mk" line 85: while evaluating "${:U:sh" with value "": Unclosed expression, expecting '}' for modifier "sh"
+make: "varparse-errors.mk" line 87: while evaluating "${:U:tA" with value "": Unclosed expression, expecting '}' for modifier "tA"
+make: "varparse-errors.mk" line 89: while evaluating "${:U:tsX" with value "": Unclosed expression, expecting '}' for modifier "tsX"
+make: "varparse-errors.mk" line 91: while evaluating "${:U:ts" with value "": Unclosed expression, expecting '}' for modifier "ts"
+make: "varparse-errors.mk" line 93: while evaluating "${:U:ts\040" with value "": Unclosed expression, expecting '}' for modifier "ts\040"
+make: "varparse-errors.mk" line 95: while evaluating "${:U:u" with value "": Unclosed expression, expecting '}' for modifier "u"
+make: "varparse-errors.mk" line 97: while evaluating "${:U:H" with value ".": Unclosed expression, expecting '}' for modifier "H"
+make: "varparse-errors.mk" line 99: while evaluating "${:U:[1]" with value "": Unclosed expression, expecting '}' for modifier "[1]"
+make: "varparse-errors.mk" line 101: while evaluating "${:U:hash" with value "b2af338b": Unclosed expression, expecting '}' for modifier "hash"
+make: "varparse-errors.mk" line 103: while evaluating "${:U:range" with value "1": Unclosed expression, expecting '}' for modifier "range"
+make: "varparse-errors.mk" line 105: while evaluating "${:U:_" with value "": Unclosed expression, expecting '}' for modifier "_"
+make: "varparse-errors.mk" line 107: while evaluating "${:U:gmtime" with value "<timestamp>": Unclosed expression, expecting '}' for modifier "gmtime"
+make: "varparse-errors.mk" line 109: while evaluating "${:U:localtime" with value "<timestamp>": Unclosed expression, expecting '}' for modifier "localtime"
make: Fatal errors encountered -- cannot continue
make: stopped in unit-tests
exit status 1
Index: src/usr.bin/make/unit-tests/cond-token-string.mk
diff -u src/usr.bin/make/unit-tests/cond-token-string.mk:1.10 src/usr.bin/make/unit-tests/cond-token-string.mk:1.11
--- src/usr.bin/make/unit-tests/cond-token-string.mk:1.10 Sat Apr 20 10:18:55 2024
+++ src/usr.bin/make/unit-tests/cond-token-string.mk Fri Jul 5 19:47:22 2024
@@ -1,4 +1,4 @@
-# $NetBSD: cond-token-string.mk,v 1.10 2024/04/20 10:18:55 rillig Exp $
+# $NetBSD: cond-token-string.mk,v 1.11 2024/07/05 19:47:22 rillig Exp $
#
# Tests for quoted string literals in .if conditions.
#
@@ -11,7 +11,7 @@
# Cover the code in CondParser_String that frees the memory after parsing
# an expression based on an undefined variable.
# expect+2: Malformed conditional ("" != "${:Uvalue:Z}")
-# expect+1: while evaluating "${:Uvalue:Z}"": Unknown modifier "Z"
+# expect+1: while evaluating "${:Uvalue:Z}"" with value "value": Unknown modifier "Z"
.if "" != "${:Uvalue:Z}"
. error
.else
Index: src/usr.bin/make/unit-tests/vardebug.mk
diff -u src/usr.bin/make/unit-tests/vardebug.mk:1.10 src/usr.bin/make/unit-tests/vardebug.mk:1.11
--- src/usr.bin/make/unit-tests/vardebug.mk:1.10 Sat Apr 20 10:18:55 2024
+++ src/usr.bin/make/unit-tests/vardebug.mk Fri Jul 5 19:47:22 2024
@@ -1,4 +1,4 @@
-# $NetBSD: vardebug.mk,v 1.10 2024/04/20 10:18:55 rillig Exp $
+# $NetBSD: vardebug.mk,v 1.11 2024/07/05 19:47:22 rillig Exp $
#
# Demonstrates the debugging output for var.c.
@@ -59,7 +59,7 @@ VAR+= 3
# as "is error", without surrounding quotes.
# expect: Result of ${:unknown} is error (eval-defined, defined)
# expect+2: Malformed conditional (${:Uvariable:unknown})
-# expect+1: while evaluating "${:Uvariable:unknown}": Unknown modifier "unknown"
+# expect+1: while evaluating "${:Uvariable:unknown}" with value "variable": Unknown modifier "unknown"
.if ${:Uvariable:unknown}
.endif
Index: src/usr.bin/make/unit-tests/deptgt.exp
diff -u src/usr.bin/make/unit-tests/deptgt.exp:1.14 src/usr.bin/make/unit-tests/deptgt.exp:1.15
--- src/usr.bin/make/unit-tests/deptgt.exp:1.14 Thu Jul 4 20:18:40 2024
+++ src/usr.bin/make/unit-tests/deptgt.exp Fri Jul 5 19:47:22 2024
@@ -8,7 +8,7 @@ ParseDependency(: empty-source)
Parsing line 39: : command for empty targets list
Parsing line 40: .MAKEFLAGS: -d0
ParseDependency(.MAKEFLAGS: -d0)
-make: "deptgt.mk" line 49: while evaluating "${:U:Z}:": Unknown modifier "Z"
+make: "deptgt.mk" line 49: while evaluating "${:U:Z}:" with value "": Unknown modifier "Z"
make: "deptgt.mk" line 52: warning: Extra target 'ordinary' ignored
make: "deptgt.mk" line 55: warning: Extra target (ordinary) ignored
make: "deptgt.mk" line 58: warning: Special and mundane targets don't mix. Mundane ones ignored
Index: src/usr.bin/make/unit-tests/directive-include.mk
diff -u src/usr.bin/make/unit-tests/directive-include.mk:1.14 src/usr.bin/make/unit-tests/directive-include.mk:1.15
--- src/usr.bin/make/unit-tests/directive-include.mk:1.14 Sat Apr 20 10:18:55 2024
+++ src/usr.bin/make/unit-tests/directive-include.mk Fri Jul 5 19:47:22 2024
@@ -1,4 +1,4 @@
-# $NetBSD: directive-include.mk,v 1.14 2024/04/20 10:18:55 rillig Exp $
+# $NetBSD: directive-include.mk,v 1.15 2024/07/05 19:47:22 rillig Exp $
#
# Tests for the .include directive, which includes another file.
@@ -52,7 +52,7 @@ DQUOT= "
# expression is skipped and the file is included nevertheless.
# FIXME: Add proper error handling, no file must be included here.
# expect+2: Could not find nonexistent.mk
-# expect+1: while evaluating "${:U123:Z}.mk": Unknown modifier "Z"
+# expect+1: while evaluating "${:U123:Z}.mk" with value "123": Unknown modifier "Z"
.include "nonexistent${:U123:Z}.mk"
# The traditional include directive is seldom used.
Index: src/usr.bin/make/unit-tests/varmod-range.exp
diff -u src/usr.bin/make/unit-tests/varmod-range.exp:1.14 src/usr.bin/make/unit-tests/varmod-range.exp:1.15
--- src/usr.bin/make/unit-tests/varmod-range.exp:1.14 Thu Jul 4 20:18:40 2024
+++ src/usr.bin/make/unit-tests/varmod-range.exp Fri Jul 5 19:47:22 2024
@@ -1,7 +1,7 @@
make: "varmod-range.mk" line 43: Malformed conditional (${:range=5} != "")
-make: "varmod-range.mk" line 67: while evaluating "${:U:range=x}Rest" != "Rest"": Invalid number "x}Rest" != "Rest"" for ':range' modifier
+make: "varmod-range.mk" line 67: while evaluating "${:U:range=x}Rest" != "Rest"" with value "": Invalid number "x}Rest" != "Rest"" for ':range' modifier
make: "varmod-range.mk" line 67: Malformed conditional ("${:U:range=x}Rest" != "Rest")
-make: "varmod-range.mk" line 78: while evaluating "${:U:range=0x0}Rest" != "Rest"": Unknown modifier "x0"
+make: "varmod-range.mk" line 78: while evaluating "${:U:range=0x0}Rest" != "Rest"" with value "1": Unknown modifier "x0"
make: "varmod-range.mk" line 78: Malformed conditional ("${:U:range=0x0}Rest" != "Rest")
make: "varmod-range.mk" line 96: while evaluating variable "a b c" with value "a b c": Unknown modifier "rang"
make: "varmod-range.mk" line 96: Malformed conditional ("${a b c:L:rang}Rest" != "Rest")
Index: src/usr.bin/make/unit-tests/varmod.exp
diff -u src/usr.bin/make/unit-tests/varmod.exp:1.14 src/usr.bin/make/unit-tests/varmod.exp:1.15
--- src/usr.bin/make/unit-tests/varmod.exp:1.14 Thu Jul 4 18:53:37 2024
+++ src/usr.bin/make/unit-tests/varmod.exp Fri Jul 5 19:47:22 2024
@@ -1,6 +1,6 @@
make: "varmod.mk" line 101: To escape a dollar, use \$, not $$, at "$$:L} != """
make: "varmod.mk" line 101: Invalid variable name ':', at "$:L} != """
-make: "varmod.mk" line 107: while evaluating "${:Uword:@word@${word}$@} != "word"": Dollar followed by nothing
+make: "varmod.mk" line 107: while evaluating "${:Uword:@word@${word}$@} != "word"" with value "word": Dollar followed by nothing
make: "varmod.mk" line 117: while evaluating variable "VAR" with value "VAR": Missing delimiter ':' after modifier "P"
make: "varmod.mk" line 119: Missing argument for ".error"
make: "varmod.mk" line 126: while evaluating variable "word" with value "word": Bad modifier ":[99333000222000111000]"
@@ -9,7 +9,7 @@ make: "varmod.mk" line 130: while evalua
make: "varmod.mk" line 130: Malformed conditional (${word:L:[2147483648]})
make: "varmod.mk" line 137: while evaluating variable "word" with value "word": Invalid number "99333000222000111000}" for ':range' modifier
make: "varmod.mk" line 137: Malformed conditional (${word:L:range=99333000222000111000})
-make: "varmod.mk" line 145: while evaluating "${:${:Ugmtime=\\}}": Invalid time value "\"
+make: "varmod.mk" line 145: while evaluating "${:${:Ugmtime=\\}}" with value "": Invalid time value "\"
make: "varmod.mk" line 145: Malformed conditional (${:${:Ugmtime=\\}})
make: "varmod.mk" line 160: while evaluating variable "VAR" with value "value$": Dollar followed by nothing
make: "varmod.mk" line 166: while evaluating variable "VAR" with value "value$": Dollar followed by nothing
@@ -19,7 +19,7 @@ make: "varmod.mk" line 181: while evalua
make: "varmod.mk" line 181: Malformed conditional (${word:[$]})
make: "varmod.mk" line 198: while evaluating variable "VAR" with value "value$ appended$": Dollar followed by nothing
make: "varmod.mk" line 198: while evaluating variable "VAR" with value "value<space>appended": Invalid variable name '}', at "$} != "set""
-make: "varmod.mk" line 202: while evaluating "${:Ufallback$} != "fallback"": Invalid variable name '}', at "$} != "fallback""
+make: "varmod.mk" line 202: while evaluating "${:Ufallback$} != "fallback"" with value "": Invalid variable name '}', at "$} != "fallback""
make: "varmod.mk" line 207: while evaluating variable "%y" with value "%y": Invalid time value "1000$"
make: "varmod.mk" line 207: Malformed conditional (${%y:L:gmtime=1000$})
make: "varmod.mk" line 214: while evaluating variable "%y" with value "%y": Invalid time value "1000$"
Index: src/usr.bin/make/unit-tests/deptgt.mk
diff -u src/usr.bin/make/unit-tests/deptgt.mk:1.17 src/usr.bin/make/unit-tests/deptgt.mk:1.18
--- src/usr.bin/make/unit-tests/deptgt.mk:1.17 Sat Apr 20 10:18:55 2024
+++ src/usr.bin/make/unit-tests/deptgt.mk Fri Jul 5 19:47:22 2024
@@ -1,4 +1,4 @@
-# $NetBSD: deptgt.mk,v 1.17 2024/04/20 10:18:55 rillig Exp $
+# $NetBSD: deptgt.mk,v 1.18 2024/07/05 19:47:22 rillig Exp $
#
# Tests for special targets like .BEGIN or .SUFFIXES in dependency
# declarations.
@@ -45,7 +45,7 @@ ${:U}: empty-source
# expansion would be to use the variable modifier '::=' to modify the
# targets. This in turn would be such an extreme and unreliable edge case
# that nobody uses it.
-# expect+1: while evaluating "${:U:Z}:": Unknown modifier "Z"
+# expect+1: while evaluating "${:U:Z}:" with value "": Unknown modifier "Z"
$$$$$$$${:U:Z}:
# expect+1: warning: Extra target 'ordinary' ignored
Index: src/usr.bin/make/unit-tests/varmod-to-separator.mk
diff -u src/usr.bin/make/unit-tests/varmod-to-separator.mk:1.17 src/usr.bin/make/unit-tests/varmod-to-separator.mk:1.18
--- src/usr.bin/make/unit-tests/varmod-to-separator.mk:1.17 Thu Jul 4 18:53:37 2024
+++ src/usr.bin/make/unit-tests/varmod-to-separator.mk Fri Jul 5 19:47:22 2024
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-to-separator.mk,v 1.17 2024/07/04 18:53:37 rillig Exp $
+# $NetBSD: varmod-to-separator.mk,v 1.18 2024/07/05 19:47:22 rillig Exp $
#
# Tests for the :ts variable modifier, which joins the words of the variable
# using an arbitrary character as word separator.
@@ -262,7 +262,7 @@ WORDS= one two three four five six
# happens for non-octal digits. From 2003.07.23.18.06.46 to
# 2016.02.27.16.20.06, the result was '1E2', since 2016.03.07.20.20.35 make no
# longer accepts this escape and complains.
-# expect+2: while evaluating "${:Ua b:ts\69}": Bad modifier ":ts\69"
+# expect+2: while evaluating "${:Ua b:ts\69}" with value "a b": Bad modifier ":ts\69"
# expect+1: Malformed conditional (${:Ua b:ts\69})
.if ${:Ua b:ts\69}
. error
@@ -271,7 +271,7 @@ WORDS= one two three four five six
.endif
# Try whether bmake is Unicode-ready.
-# expect+2: while evaluating "${:Ua b:ts\x1F60E}": Invalid character number at "1F60E}"
+# expect+2: while evaluating "${:Ua b:ts\x1F60E}" with value "a b": Invalid character number at "1F60E}"
# expect+1: Malformed conditional (${:Ua b:ts\x1F60E})
.if ${:Ua b:ts\x1F60E} # U+1F60E "smiling face with sunglasses"
. error
Index: src/usr.bin/make/unit-tests/varmod.mk
diff -u src/usr.bin/make/unit-tests/varmod.mk:1.17 src/usr.bin/make/unit-tests/varmod.mk:1.18
--- src/usr.bin/make/unit-tests/varmod.mk:1.17 Thu Jul 4 18:53:37 2024
+++ src/usr.bin/make/unit-tests/varmod.mk Fri Jul 5 19:47:22 2024
@@ -1,4 +1,4 @@
-# $NetBSD: varmod.mk,v 1.17 2024/07/04 18:53:37 rillig Exp $
+# $NetBSD: varmod.mk,v 1.18 2024/07/05 19:47:22 rillig Exp $
#
# Tests for variable modifiers, such as :Q, :S,from,to or :Ufallback.
#
@@ -103,7 +103,7 @@ DOLLAR2= ${:U\$}
.endif
# A '$' followed by nothing is an error as well.
-# expect+1: while evaluating "${:Uword:@word@${word}$@} != "word"": Dollar followed by nothing
+# expect+1: while evaluating "${:Uword:@word@${word}$@} != "word"" with value "word": Dollar followed by nothing
.if ${:Uword:@word@${word}$@} != "word"
. error
.endif
@@ -140,7 +140,7 @@ VAR= STOP
# In an indirect modifier, the delimiter is '\0', which at the same time marks
# the end of the string. The sequence '\\' '\0' is not an escaped delimiter,
# as it would be wrong to skip past the end of the string.
-# expect+2: while evaluating "${:${:Ugmtime=\\}}": Invalid time value "\"
+# expect+2: while evaluating "${:${:Ugmtime=\\}}" with value "": Invalid time value "\"
# expect+1: Malformed conditional (${:${:Ugmtime=\\}})
.if ${:${:Ugmtime=\\}}
. error
@@ -198,7 +198,7 @@ VAR_DOLLAR= VAR$$
.if ${VAR:Dset$} != "set"
. error
.endif
-# expect+1: while evaluating "${:Ufallback$} != "fallback"": Invalid variable name '}', at "$} != "fallback""
+# expect+1: while evaluating "${:Ufallback$} != "fallback"" with value "": Invalid variable name '}', at "$} != "fallback""
.if ${:Ufallback$} != "fallback"
. error
.endif
Index: src/usr.bin/make/unit-tests/directive-for-errors.exp
diff -u src/usr.bin/make/unit-tests/directive-for-errors.exp:1.6 src/usr.bin/make/unit-tests/directive-for-errors.exp:1.7
--- src/usr.bin/make/unit-tests/directive-for-errors.exp:1.6 Sat Apr 20 10:18:55 2024
+++ src/usr.bin/make/unit-tests/directive-for-errors.exp Fri Jul 5 19:47:22 2024
@@ -8,7 +8,7 @@ make: "directive-for-errors.mk" line 44:
make: "directive-for-errors.mk" line 52: no iteration variables in for
make: "directive-for-errors.mk" line 64: Wrong number of words (5) in .for substitution list with 3 variables
make: "directive-for-errors.mk" line 78: missing `in' in for
-make: "directive-for-errors.mk" line 89: while evaluating "${:U3:Z} 4": Unknown modifier "Z"
+make: "directive-for-errors.mk" line 89: while evaluating "${:U3:Z} 4" with value "3": Unknown modifier "Z"
make: "directive-for-errors.mk" line 90: warning: Should not be reached.
make: "directive-for-errors.mk" line 90: warning: Should not be reached.
make: "directive-for-errors.mk" line 90: warning: Should not be reached.
Index: src/usr.bin/make/unit-tests/varmod-loop-delete.exp
diff -u src/usr.bin/make/unit-tests/varmod-loop-delete.exp:1.6 src/usr.bin/make/unit-tests/varmod-loop-delete.exp:1.7
--- src/usr.bin/make/unit-tests/varmod-loop-delete.exp:1.6 Thu Jul 4 20:18:40 2024
+++ src/usr.bin/make/unit-tests/varmod-loop-delete.exp Fri Jul 5 19:47:22 2024
@@ -1,4 +1,4 @@
-make: "varmod-loop-delete.mk" line 20: while evaluating variable "VAR" with value "${:U:@VAR@@} rest of the value": while evaluating "${:U:@VAR@@} rest of the value": Cannot delete variable "VAR" while it is used
+make: "varmod-loop-delete.mk" line 20: while evaluating variable "VAR" with value "${:U:@VAR@@} rest of the value": while evaluating "${:U:@VAR@@} rest of the value" with value "": Cannot delete variable "VAR" while it is used
make: Fatal errors encountered -- cannot continue
make: stopped making "all" in unit-tests
exit status 1
Index: src/usr.bin/make/unit-tests/directive-for-errors.mk
diff -u src/usr.bin/make/unit-tests/directive-for-errors.mk:1.11 src/usr.bin/make/unit-tests/directive-for-errors.mk:1.12
--- src/usr.bin/make/unit-tests/directive-for-errors.mk:1.11 Sat Jun 1 11:24:11 2024
+++ src/usr.bin/make/unit-tests/directive-for-errors.mk Fri Jul 5 19:47:22 2024
@@ -1,4 +1,4 @@
-# $NetBSD: directive-for-errors.mk,v 1.11 2024/06/01 11:24:11 rillig Exp $
+# $NetBSD: directive-for-errors.mk,v 1.12 2024/07/05 19:47:22 rillig Exp $
#
# Tests for error handling in .for loops.
@@ -85,7 +85,7 @@ ${:U\\}= backslash # see whether the "va
#
# XXX: As of 2020-12-31, Var_Subst doesn't report any errors, therefore
# the loop body is expanded as if no error had happened.
-# expect+1: while evaluating "${:U3:Z} 4": Unknown modifier "Z"
+# expect+1: while evaluating "${:U3:Z} 4" with value "3": Unknown modifier "Z"
.for i in 1 2 ${:U3:Z} 4
. warning Should not be reached.
.endfor
Index: src/usr.bin/make/unit-tests/directive-for-escape.exp
diff -u src/usr.bin/make/unit-tests/directive-for-escape.exp:1.27 src/usr.bin/make/unit-tests/directive-for-escape.exp:1.28
--- src/usr.bin/make/unit-tests/directive-for-escape.exp:1.27 Fri Jul 5 18:59:33 2024
+++ src/usr.bin/make/unit-tests/directive-for-escape.exp Fri Jul 5 19:47:22 2024
@@ -1,17 +1,17 @@
For: end for 1
For: loop body with chars = !"#$%&'()*+,-./0-9:;<=>?@A-Z[\]_^a-z{|}~:
-# expect+2: while evaluating "${:U!"": Unclosed expression, expecting '}' for modifier "U!""
+# expect+2: while evaluating "${:U!"" with value "!"": Unclosed expression, expecting '}' for modifier "U!""
# expect+1: !"
. info ${:U!"#$%&'()*+,-./0-9\:;<=>?@A-Z[\\]_^a-z{|\}~}
-make: "directive-for-escape.mk" line 21: while evaluating "${:U!"": Unclosed expression, expecting '}' for modifier "U!""
+make: "directive-for-escape.mk" line 21: while evaluating "${:U!"" with value "!"": Unclosed expression, expecting '}' for modifier "U!""
in .for loop from directive-for-escape.mk:18 with chars = !"#$%&'()*+,-./0-9:;<=>?@A-Z[\]_^a-z{|}~
make: "directive-for-escape.mk" line 21: !"
For: end for 1
For: loop body with chars = !"\\#$%&'()*+,-./0-9:;<=>?@A-Z[\]_^a-z{|}~:
-# expect+2: while evaluating "${:U!"\\\\": Unclosed expression, expecting '}' for modifier "U!"\\\\"
+# expect+2: while evaluating "${:U!"\\\\" with value "!"\\": Unclosed expression, expecting '}' for modifier "U!"\\\\"
# expect+1: !"\\
. info ${:U!"\\\\#$%&'()*+,-./0-9\:;<=>?@A-Z[\\]_^a-z{|\}~}
-make: "directive-for-escape.mk" line 33: while evaluating "${:U!"\\\\": Unclosed expression, expecting '}' for modifier "U!"\\\\"
+make: "directive-for-escape.mk" line 33: while evaluating "${:U!"\\\\" with value "!"\\": Unclosed expression, expecting '}' for modifier "U!"\\\\"
in .for loop from directive-for-escape.mk:30 with chars = !"\\#$%&'()*+,-./0-9:;<=>?@A-Z[\]_^a-z{|}~
make: "directive-for-escape.mk" line 33: !"\\
For: end for 1
Index: src/usr.bin/make/unit-tests/var-eval-short.exp
diff -u src/usr.bin/make/unit-tests/var-eval-short.exp:1.27 src/usr.bin/make/unit-tests/var-eval-short.exp:1.28
--- src/usr.bin/make/unit-tests/var-eval-short.exp:1.27 Thu Jul 4 20:18:40 2024
+++ src/usr.bin/make/unit-tests/var-eval-short.exp Fri Jul 5 19:47:22 2024
@@ -1,4 +1,4 @@
-make: "var-eval-short.mk" line 46: while evaluating "${:Uword:@${FAIL}@expr@}": In the :@ modifier, the variable name "${FAIL}" must not contain a dollar
+make: "var-eval-short.mk" line 46: while evaluating "${:Uword:@${FAIL}@expr@}" with value "": In the :@ modifier, the variable name "${FAIL}" must not contain a dollar
make: "var-eval-short.mk" line 46: Malformed conditional (0 && ${:Uword:@${FAIL}@expr@})
Parsing line 159: .if 0 && ${0:?${FAIL}then:${FAIL}else}
CondParser_Eval: 0 && ${0:?${FAIL}then:${FAIL}else}
Index: src/usr.bin/make/unit-tests/directive-for-escape.mk
diff -u src/usr.bin/make/unit-tests/directive-for-escape.mk:1.25 src/usr.bin/make/unit-tests/directive-for-escape.mk:1.26
--- src/usr.bin/make/unit-tests/directive-for-escape.mk:1.25 Fri Jul 5 18:59:33 2024
+++ src/usr.bin/make/unit-tests/directive-for-escape.mk Fri Jul 5 19:47:22 2024
@@ -1,4 +1,4 @@
-# $NetBSD: directive-for-escape.mk,v 1.25 2024/07/05 18:59:33 rillig Exp $
+# $NetBSD: directive-for-escape.mk,v 1.26 2024/07/05 19:47:22 rillig Exp $
#
# Test escaping of special characters in the iteration values of a .for loop.
# These values get expanded later using the :U variable modifier, and this
@@ -16,7 +16,7 @@ ASCII= !"\#$$%&'()*+,-./0-9:;<=>?@A-Z[\]
# the loop. Not only would it need the escaping for the variable modifier
# ':U' but also the escaping for the line-end comment.
.for chars in ${ASCII}
-# expect+2: while evaluating "${:U!"": Unclosed expression, expecting '}' for modifier "U!""
+# expect+2: while evaluating "${:U!"" with value "!"": Unclosed expression, expecting '}' for modifier "U!""
# expect+1: !"
. info ${chars}
.endfor
@@ -28,7 +28,7 @@ ASCII= !"\#$$%&'()*+,-./0-9:;<=>?@A-Z[\]
# at all.
ASCII.2020-12-31= !"\\\#$$%&'()*+,-./0-9:;<=>?@A-Z[\]_^a-z{|}~
.for chars in ${ASCII.2020-12-31}
-# expect+2: while evaluating "${:U!"\\\\": Unclosed expression, expecting '}' for modifier "U!"\\\\"
+# expect+2: while evaluating "${:U!"\\\\" with value "!"\\": Unclosed expression, expecting '}' for modifier "U!"\\\\"
# expect+1: !"\\
. info ${chars}
.endfor
Index: src/usr.bin/make/unit-tests/directive-for.mk
diff -u src/usr.bin/make/unit-tests/directive-for.mk:1.25 src/usr.bin/make/unit-tests/directive-for.mk:1.26
--- src/usr.bin/make/unit-tests/directive-for.mk:1.25 Sat Apr 20 10:18:55 2024
+++ src/usr.bin/make/unit-tests/directive-for.mk Fri Jul 5 19:47:22 2024
@@ -1,4 +1,4 @@
-# $NetBSD: directive-for.mk,v 1.25 2024/04/20 10:18:55 rillig Exp $
+# $NetBSD: directive-for.mk,v 1.26 2024/07/05 19:47:22 rillig Exp $
#
# Tests for the .for directive.
#
@@ -206,7 +206,7 @@ INDIRECT= ${DIRECT}
# XXX: A parse error or evaluation error in the items of the .for loop
# should skip the whole loop. As of 2023-05-09, the loop is expanded as
# usual.
-# expect+1: while evaluating "${:Uword2:Z}-after word3": Unknown modifier "Z"
+# expect+1: while evaluating "${:Uword2:Z}-after word3" with value "word2": Unknown modifier "Z"
.for var in word1 before-${:Uword2:Z}-after word3
. info XXX: Should not reach ${var}
.endfor
Index: src/usr.bin/make/unit-tests/varmod-assign.exp
diff -u src/usr.bin/make/unit-tests/varmod-assign.exp:1.25 src/usr.bin/make/unit-tests/varmod-assign.exp:1.26
--- src/usr.bin/make/unit-tests/varmod-assign.exp:1.25 Thu Jul 4 18:53:37 2024
+++ src/usr.bin/make/unit-tests/varmod-assign.exp Fri Jul 5 19:47:22 2024
@@ -37,9 +37,9 @@ Global: .MAKEOVERRIDES = FIRST LAST LAS
Result of ${CMD_NEW_VAR::=new-value} is "" (eval, undefined)
Global: .MAKEFLAGS = -r -k -d v -d 0 -d v -d
Global: .MAKEFLAGS = -r -k -d v -d 0 -d v -d 0
-make: in target "mod-assign-empty": while evaluating "${::=value}": Bad modifier ":"
+make: in target "mod-assign-empty": while evaluating "${::=value}" with value "": Bad modifier ":"
mod-assign-empty: value}
-make: in target "mod-assign-empty": while evaluating "${:Uvalue::=overwritten}": Bad modifier ":"
+make: in target "mod-assign-empty": while evaluating "${:Uvalue::=overwritten}" with value "value": Bad modifier ":"
mod-assign-empty: overwritten}
mod-assign-empty: VAR=overwritten
make: in target "mod-assign-parse": while evaluating variable "ASSIGN" with value "": Unknown modifier ":x"
Index: src/usr.bin/make/unit-tests/directive-for.exp
diff -u src/usr.bin/make/unit-tests/directive-for.exp:1.23 src/usr.bin/make/unit-tests/directive-for.exp:1.24
--- src/usr.bin/make/unit-tests/directive-for.exp:1.23 Thu Jul 4 17:47:54 2024
+++ src/usr.bin/make/unit-tests/directive-for.exp Fri Jul 5 19:47:22 2024
@@ -17,7 +17,7 @@ make: "directive-for.mk" line 146: }{ }{
make: "directive-for.mk" line 166: invalid character ':' in .for loop variable name
make: "directive-for.mk" line 173: invalid character '$' in .for loop variable name
make: "directive-for.mk" line 185: invalid character '$' in .for loop variable name
-make: "directive-for.mk" line 210: while evaluating "${:Uword2:Z}-after word3": Unknown modifier "Z"
+make: "directive-for.mk" line 210: while evaluating "${:Uword2:Z}-after word3" with value "word2": Unknown modifier "Z"
make: "directive-for.mk" line 211: XXX: Should not reach word1
make: "directive-for.mk" line 211: XXX: Should not reach before--after
make: "directive-for.mk" line 211: XXX: Should not reach word3
Index: src/usr.bin/make/unit-tests/varmod-gmtime.mk
diff -u src/usr.bin/make/unit-tests/varmod-gmtime.mk:1.23 src/usr.bin/make/unit-tests/varmod-gmtime.mk:1.24
--- src/usr.bin/make/unit-tests/varmod-gmtime.mk:1.23 Thu Jul 4 17:47:54 2024
+++ src/usr.bin/make/unit-tests/varmod-gmtime.mk Fri Jul 5 19:47:22 2024
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-gmtime.mk,v 1.23 2024/07/04 17:47:54 rillig Exp $
+# $NetBSD: varmod-gmtime.mk,v 1.24 2024/07/05 19:47:22 rillig Exp $
#
# Tests for the :gmtime variable modifier, which formats a timestamp
# using strftime(3) in UTC.
@@ -56,7 +56,7 @@
# 1970. Going back 50 years in the past is not a practical use case for
# make. Therefore, since var.c 1.631, negative time stamps produce a
# parse error.
-# expect+2: while evaluating "${:L:gmtime=-1} != """: Invalid time value "-1"
+# expect+2: while evaluating "${:L:gmtime=-1} != """ with value "": Invalid time value "-1"
# expect+1: Malformed conditional (${:L:gmtime=-1} != "")
.if ${:L:gmtime=-1} != ""
. error
@@ -67,7 +67,7 @@
# Spaces were allowed before var.c 1.631 from 2020-10-31 21:40:20, not
# because it would make sense but just as a side-effect from using strtoul.
-# expect+2: while evaluating "${:L:gmtime= 1} != """: Invalid time value " 1"
+# expect+2: while evaluating "${:L:gmtime= 1} != """ with value "": Invalid time value " 1"
# expect+1: Malformed conditional (${:L:gmtime= 1} != "")
.if ${:L:gmtime= 1} != ""
. error
@@ -115,7 +115,7 @@
#
# Since var.c 1.631 from 2020-10-31, the overflow is detected and produces a
# parse error.
-# expect+2: while evaluating "${:L:gmtime=10000000000000000000000000000000} != """: Invalid time value "10000000000000000000000000000000"
+# expect+2: while evaluating "${:L:gmtime=10000000000000000000000000000000} != """ with value "": Invalid time value "10000000000000000000000000000000"
# expect+1: Malformed conditional (${:L:gmtime=10000000000000000000000000000000} != "")
.if ${:L:gmtime=10000000000000000000000000000000} != ""
. error
@@ -128,7 +128,7 @@
# stopped after the '=', and the remaining string was parsed for more variable
# modifiers. Because of the unknown modifier 'e' from the 'error', the whole
# variable value was discarded and thus not printed.
-# expect+2: while evaluating "${:L:gmtime=error} != """: Invalid time value "error"
+# expect+2: while evaluating "${:L:gmtime=error} != """ with value "": Invalid time value "error"
# expect+1: Malformed conditional (${:L:gmtime=error} != "")
.if ${:L:gmtime=error} != ""
. error
Index: src/usr.bin/make/unit-tests/moderrs.exp
diff -u src/usr.bin/make/unit-tests/moderrs.exp:1.40 src/usr.bin/make/unit-tests/moderrs.exp:1.41
--- src/usr.bin/make/unit-tests/moderrs.exp:1.40 Fri Jul 5 18:59:33 2024
+++ src/usr.bin/make/unit-tests/moderrs.exp Fri Jul 5 19:47:22 2024
@@ -72,7 +72,7 @@ mod-ts-parse:
15152535558513521534
make: in target "mod-ts-parse": while evaluating variable "FIB" with value "1 1 2 3 5 8 13 21 34": Bad modifier ":ts\65oct"
65oct}
-make: in target "mod-ts-parse": while evaluating "${:U${FIB}:ts\65oct} # bad modifier, variable name is """: Bad modifier ":ts\65oct"
+make: in target "mod-ts-parse": while evaluating "${:U${FIB}:ts\65oct} # bad modifier, variable name is """ with value "1 1 2 3 5 8 13 21 34": Bad modifier ":ts\65oct"
65oct}
make: in target "mod-ts-parse": while evaluating variable "FIB" with value "1 1 2 3 5 8 13 21 34": Bad modifier ":tsxy"
xy}
Index: src/usr.bin/make/unit-tests/moderrs.mk
diff -u src/usr.bin/make/unit-tests/moderrs.mk:1.37 src/usr.bin/make/unit-tests/moderrs.mk:1.38
--- src/usr.bin/make/unit-tests/moderrs.mk:1.37 Fri Jul 5 18:59:33 2024
+++ src/usr.bin/make/unit-tests/moderrs.mk Fri Jul 5 19:47:22 2024
@@ -1,4 +1,4 @@
-# $NetBSD: moderrs.mk,v 1.37 2024/07/05 18:59:33 rillig Exp $
+# $NetBSD: moderrs.mk,v 1.38 2024/07/05 19:47:22 rillig Exp $
#
# various modifier error tests
@@ -135,7 +135,7 @@ mod-ts-parse: print-header print-footer
@echo ${FIB:ts\65} # octal 065 == U+0035 == '5'
# expect: make: in target "mod-ts-parse": while evaluating variable "FIB" with value "1 1 2 3 5 8 13 21 34": Bad modifier ":ts\65oct"
@echo ${FIB:ts\65oct} # bad modifier
-# expect: make: in target "mod-ts-parse": while evaluating "${:U${FIB}:ts\65oct} # bad modifier, variable name is """: Bad modifier ":ts\65oct"
+# expect: make: in target "mod-ts-parse": while evaluating "${:U${FIB}:ts\65oct} # bad modifier, variable name is """ with value "1 1 2 3 5 8 13 21 34": Bad modifier ":ts\65oct"
@echo ${:U${FIB}:ts\65oct} # bad modifier, variable name is ""
# expect: make: in target "mod-ts-parse": while evaluating variable "FIB" with value "1 1 2 3 5 8 13 21 34": Bad modifier ":tsxy"
@echo ${FIB:tsxy} # modifier too long
Index: src/usr.bin/make/unit-tests/var-eval-short.mk
diff -u src/usr.bin/make/unit-tests/var-eval-short.mk:1.12 src/usr.bin/make/unit-tests/var-eval-short.mk:1.13
--- src/usr.bin/make/unit-tests/var-eval-short.mk:1.12 Sat Apr 20 10:18:55 2024
+++ src/usr.bin/make/unit-tests/var-eval-short.mk Fri Jul 5 19:47:22 2024
@@ -1,4 +1,4 @@
-# $NetBSD: var-eval-short.mk,v 1.12 2024/04/20 10:18:55 rillig Exp $
+# $NetBSD: var-eval-short.mk,v 1.13 2024/07/05 19:47:22 rillig Exp $
#
# Tests for each variable modifier to ensure that they only do the minimum
# necessary computations. If the result of the expression is irrelevant,
@@ -41,7 +41,7 @@ FAIL= ${:!echo unexpected 1>&2!}
# after the loop, when undefining the temporary global loop variable.
# Since var.c 1.907 from 2021-04-04, a '$' is no longer allowed in the
# variable name.
-# expect+2: while evaluating "${:Uword:@${FAIL}@expr@}": In the :@ modifier, the variable name "${FAIL}" must not contain a dollar
+# expect+2: while evaluating "${:Uword:@${FAIL}@expr@}" with value "": In the :@ modifier, the variable name "${FAIL}" must not contain a dollar
# expect+1: Malformed conditional (0 && ${:Uword:@${FAIL}@expr@})
.if 0 && ${:Uword:@${FAIL}@expr@}
.endif
Index: src/usr.bin/make/unit-tests/varmod-range.mk
diff -u src/usr.bin/make/unit-tests/varmod-range.mk:1.12 src/usr.bin/make/unit-tests/varmod-range.mk:1.13
--- src/usr.bin/make/unit-tests/varmod-range.mk:1.12 Thu Jul 4 17:47:54 2024
+++ src/usr.bin/make/unit-tests/varmod-range.mk Fri Jul 5 19:47:22 2024
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-range.mk,v 1.12 2024/07/04 17:47:54 rillig Exp $
+# $NetBSD: varmod-range.mk,v 1.13 2024/07/05 19:47:22 rillig Exp $
#
# Tests for the :range variable modifier, which generates sequences
# of integers from the given range.
@@ -62,7 +62,7 @@
#
# Since 2020-11-01, the parser issues a more precise "Invalid number" error
# instead.
-# expect+2: while evaluating "${:U:range=x}Rest" != "Rest"": Invalid number "x}Rest" != "Rest"" for ':range' modifier
+# expect+2: while evaluating "${:U:range=x}Rest" != "Rest"" with value "": Invalid number "x}Rest" != "Rest"" for ':range' modifier
# expect+1: Malformed conditional ("${:U:range=x}Rest" != "Rest")
.if "${:U:range=x}Rest" != "Rest"
. error
@@ -73,7 +73,7 @@
# The upper limit of the range must always be given in decimal.
# This parse error stops at the 'x', trying to parse it as a variable
# modifier.
-# expect+2: while evaluating "${:U:range=0x0}Rest" != "Rest"": Unknown modifier "x0"
+# expect+2: while evaluating "${:U:range=0x0}Rest" != "Rest"" with value "1": Unknown modifier "x0"
# expect+1: Malformed conditional ("${:U:range=0x0}Rest" != "Rest")
.if "${:U:range=0x0}Rest" != "Rest"
. error
Index: src/usr.bin/make/unit-tests/vardebug.exp
diff -u src/usr.bin/make/unit-tests/vardebug.exp:1.35 src/usr.bin/make/unit-tests/vardebug.exp:1.36
--- src/usr.bin/make/unit-tests/vardebug.exp:1.35 Sat Apr 20 10:18:55 2024
+++ src/usr.bin/make/unit-tests/vardebug.exp Fri Jul 5 19:47:22 2024
@@ -54,7 +54,7 @@ Var_Parse: ${:Uvariable:unknown} (eval-d
Evaluating modifier ${:U...} on value "" (eval-defined, undefined)
Result of ${:Uvariable} is "variable" (eval-defined, defined)
Evaluating modifier ${:u...} on value "variable" (eval-defined, defined)
-make: "vardebug.mk" line 63: while evaluating "${:Uvariable:unknown}": Unknown modifier "unknown"
+make: "vardebug.mk" line 63: while evaluating "${:Uvariable:unknown}" with value "variable": Unknown modifier "unknown"
Result of ${:unknown} is error (eval-defined, defined)
make: "vardebug.mk" line 63: Malformed conditional (${:Uvariable:unknown})
Var_Parse: ${UNDEFINED} (eval-defined)
Index: src/usr.bin/make/unit-tests/varmod-edge.exp
diff -u src/usr.bin/make/unit-tests/varmod-edge.exp:1.22 src/usr.bin/make/unit-tests/varmod-edge.exp:1.23
--- src/usr.bin/make/unit-tests/varmod-edge.exp:1.22 Fri Jul 5 18:59:33 2024
+++ src/usr.bin/make/unit-tests/varmod-edge.exp Fri Jul 5 19:47:22 2024
@@ -1,7 +1,7 @@
make: "varmod-edge.mk" line 186: ok M-paren
make: "varmod-edge.mk" line 186: ok M-mixed
make: "varmod-edge.mk" line 186: ok M-unescape
-make: "varmod-edge.mk" line 168: while evaluating variable "MOD.M-nest-mix" with value "${INP.M-nest-mix:M${:U*)}}": while evaluating variable "INP.M-nest-mix" with value "(parentheses)": while evaluating "${:U*)": Unclosed expression, expecting '}' for modifier "U*)"
+make: "varmod-edge.mk" line 168: while evaluating variable "MOD.M-nest-mix" with value "${INP.M-nest-mix:M${:U*)}}": while evaluating variable "INP.M-nest-mix" with value "(parentheses)": while evaluating "${:U*)" with value "*)": Unclosed expression, expecting '}' for modifier "U*)"
in .for loop from varmod-edge.mk:164 with test = M-nest-mix
make: "varmod-edge.mk" line 186: ok M-nest-mix
make: "varmod-edge.mk" line 186: ok M-nest-brk
@@ -22,9 +22,9 @@ make: "varmod-edge.mk" line 168: while e
make: "varmod-edge.mk" line 168: while evaluating variable "MOD.colons" with value "${INP.colons::::}": while evaluating variable "INP.colons" with value "": Unknown modifier ":"
in .for loop from varmod-edge.mk:164 with test = colons
make: "varmod-edge.mk" line 186: ok colons
-make: "varmod-edge.mk" line 197: while evaluating "${:Z}": Unknown modifier "Z"
+make: "varmod-edge.mk" line 197: while evaluating "${:Z}" with value "": Unknown modifier "Z"
make: "varmod-edge.mk" line 197: Malformed conditional (${:Z})
-make: "varmod-edge.mk" line 211: while evaluating "${:S,}": Unfinished modifier (',' missing)
+make: "varmod-edge.mk" line 211: while evaluating "${:S,}" with value "": Unfinished modifier (',' missing)
make: "varmod-edge.mk" line 211: Malformed conditional (${:S,})
make: Fatal errors encountered -- cannot continue
make: stopped making "all" in unit-tests
Index: src/usr.bin/make/unit-tests/varmod-match-escape.exp
diff -u src/usr.bin/make/unit-tests/varmod-match-escape.exp:1.22 src/usr.bin/make/unit-tests/varmod-match-escape.exp:1.23
--- src/usr.bin/make/unit-tests/varmod-match-escape.exp:1.22 Thu Jul 4 20:18:40 2024
+++ src/usr.bin/make/unit-tests/varmod-match-escape.exp Fri Jul 5 19:47:22 2024
@@ -33,7 +33,7 @@ Comparing ":" != "::"
make: "varmod-match-escape.mk" line 43: warning: XXX: Oops
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 69: while evaluating "${:U\$:M\$} != """ with value "$": Dollar followed by nothing
make: "varmod-match-escape.mk" line 110: warning: while evaluating variable "WORDS" with value "A A] A]] B B] B]] ] ]] ]]] a a] a]]": Unfinished character list in pattern '[A-]' of modifier ':M'
make: "varmod-match-escape.mk" line 110: warning: while evaluating variable "WORDS" with value "A A] A]] B B] B]] ] ]] ]]] a a] a]]": Unfinished character list in pattern '[^A-]' of modifier ':M'
make: Fatal errors encountered -- cannot continue
Index: src/usr.bin/make/unit-tests/varmod-edge.mk
diff -u src/usr.bin/make/unit-tests/varmod-edge.mk:1.24 src/usr.bin/make/unit-tests/varmod-edge.mk:1.25
--- src/usr.bin/make/unit-tests/varmod-edge.mk:1.24 Fri Jul 5 18:59:33 2024
+++ src/usr.bin/make/unit-tests/varmod-edge.mk Fri Jul 5 19:47:22 2024
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-edge.mk,v 1.24 2024/07/05 18:59:33 rillig Exp $
+# $NetBSD: varmod-edge.mk,v 1.25 2024/07/05 19:47:22 rillig Exp $
#
# Tests for edge cases in variable modifiers.
#
@@ -169,7 +169,7 @@ EXP.colons= # empty
# expect+17: ok M-paren
# expect+16: ok M-mixed
# expect+15: ok M-unescape
-# expect-4: while evaluating variable "MOD.M-nest-mix" with value "${INP.M-nest-mix:M${:U*)}}": while evaluating variable "INP.M-nest-mix" with value "(parentheses)": while evaluating "${:U*)": Unclosed expression, expecting '}' for modifier "U*)"
+# expect-4: while evaluating variable "MOD.M-nest-mix" with value "${INP.M-nest-mix:M${:U*)}}": while evaluating variable "INP.M-nest-mix" with value "(parentheses)": while evaluating "${:U*)" with value "*)": Unclosed expression, expecting '}' for modifier "U*)"
# expect+13: ok M-nest-mix
# expect+12: ok M-nest-brk
# expect+11: ok M-pat-err
@@ -193,7 +193,7 @@ EXP.colons= # empty
# XXX: The error message should mention the variable name of the expression,
# even though that name is empty in this case.
# expect+2: Malformed conditional (${:Z})
-# expect+1: while evaluating "${:Z}": Unknown modifier "Z"
+# expect+1: while evaluating "${:Z}" with value "": Unknown modifier "Z"
.if ${:Z}
. error
.else
@@ -206,7 +206,7 @@ EXP.colons= # empty
# variable name with quotes, leading to the rather confusing "Unfinished
# modifier for (',' missing)", having two spaces in a row.
#
-# expect+2: while evaluating "${:S,}": Unfinished modifier (',' missing)
+# expect+2: while evaluating "${:S,}" with value "": Unfinished modifier (',' missing)
# expect+1: Malformed conditional (${:S,})
.if ${:S,}
. error
Index: src/usr.bin/make/unit-tests/varmod-gmtime.exp
diff -u src/usr.bin/make/unit-tests/varmod-gmtime.exp:1.19 src/usr.bin/make/unit-tests/varmod-gmtime.exp:1.20
--- src/usr.bin/make/unit-tests/varmod-gmtime.exp:1.19 Thu Jul 4 20:18:40 2024
+++ src/usr.bin/make/unit-tests/varmod-gmtime.exp Fri Jul 5 19:47:22 2024
@@ -1,10 +1,10 @@
-make: "varmod-gmtime.mk" line 61: while evaluating "${:L:gmtime=-1} != """: Invalid time value "-1"
+make: "varmod-gmtime.mk" line 61: while evaluating "${:L:gmtime=-1} != """ with value "": Invalid time value "-1"
make: "varmod-gmtime.mk" line 61: Malformed conditional (${:L:gmtime=-1} != "")
-make: "varmod-gmtime.mk" line 72: while evaluating "${:L:gmtime= 1} != """: Invalid time value " 1"
+make: "varmod-gmtime.mk" line 72: while evaluating "${:L:gmtime= 1} != """ with value "": Invalid time value " 1"
make: "varmod-gmtime.mk" line 72: Malformed conditional (${:L:gmtime= 1} != "")
-make: "varmod-gmtime.mk" line 120: while evaluating "${:L:gmtime=10000000000000000000000000000000} != """: Invalid time value "10000000000000000000000000000000"
+make: "varmod-gmtime.mk" line 120: while evaluating "${:L:gmtime=10000000000000000000000000000000} != """ with value "": Invalid time value "10000000000000000000000000000000"
make: "varmod-gmtime.mk" line 120: Malformed conditional (${:L:gmtime=10000000000000000000000000000000} != "")
-make: "varmod-gmtime.mk" line 133: while evaluating "${:L:gmtime=error} != """: Invalid time value "error"
+make: "varmod-gmtime.mk" line 133: while evaluating "${:L:gmtime=error} != """ with value "": Invalid time value "error"
make: "varmod-gmtime.mk" line 133: Malformed conditional (${:L:gmtime=error} != "")
make: "varmod-gmtime.mk" line 144: while evaluating variable "%Y" with value "%Y": Invalid time value "100000S,1970,bad,"
make: "varmod-gmtime.mk" line 144: Malformed conditional (${%Y:L:gmtime=100000S,1970,bad,} != "bad")
Index: src/usr.bin/make/unit-tests/varmod-ifelse.exp
diff -u src/usr.bin/make/unit-tests/varmod-ifelse.exp:1.21 src/usr.bin/make/unit-tests/varmod-ifelse.exp:1.22
--- src/usr.bin/make/unit-tests/varmod-ifelse.exp:1.21 Sun Jun 30 13:01:01 2024
+++ src/usr.bin/make/unit-tests/varmod-ifelse.exp Fri Jul 5 19:47:22 2024
@@ -46,8 +46,8 @@ make: "varmod-ifelse.mk" line 293: no
CondParser_Eval: ${DELAYED} == "two"
Comparing "two" == "two"
make: "varmod-ifelse.mk" line 296: yes
-make: "varmod-ifelse.mk" line 318: while evaluating then-branch of condition "1": while evaluating "${:X-then}:${:X-else}}": Unknown modifier "X-then"
-make: "varmod-ifelse.mk" line 318: while evaluating else-branch of condition "1": while evaluating "${:X-else}}": Unknown modifier "X-else"
+make: "varmod-ifelse.mk" line 318: while evaluating then-branch of condition "1": while evaluating "${:X-then}:${:X-else}}" with value "": Unknown modifier "X-then"
+make: "varmod-ifelse.mk" line 318: while evaluating else-branch of condition "1": while evaluating "${:X-else}}" with value "": Unknown modifier "X-else"
make: Fatal errors encountered -- cannot continue
make: stopped in unit-tests
exit status 1
Index: src/usr.bin/make/unit-tests/varmod-ifelse.mk
diff -u src/usr.bin/make/unit-tests/varmod-ifelse.mk:1.30 src/usr.bin/make/unit-tests/varmod-ifelse.mk:1.31
--- src/usr.bin/make/unit-tests/varmod-ifelse.mk:1.30 Sun Jun 30 13:01:01 2024
+++ src/usr.bin/make/unit-tests/varmod-ifelse.mk Fri Jul 5 19:47:22 2024
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-ifelse.mk,v 1.30 2024/06/30 13:01:01 rillig Exp $
+# $NetBSD: varmod-ifelse.mk,v 1.31 2024/07/05 19:47:22 rillig Exp $
#
# Tests for the ${cond:?then:else} variable modifier, which evaluates either
# the then-expression or the else-expression, depending on the condition.
@@ -313,7 +313,7 @@ BOTH= <${YES}> <${NO}>
.endif
-# expect+2: while evaluating then-branch of condition "1": while evaluating "${:X-then}:${:X-else}}": Unknown modifier "X-then"
-# expect+1: while evaluating else-branch of condition "1": while evaluating "${:X-else}}": Unknown modifier "X-else"
+# expect+2: while evaluating then-branch of condition "1": while evaluating "${:X-then}:${:X-else}}" with value "": Unknown modifier "X-then"
+# expect+1: while evaluating else-branch of condition "1": while evaluating "${:X-else}}" with value "": Unknown modifier "X-else"
.if ${1:?${:X-then}:${:X-else}}
.endif
Index: src/usr.bin/make/unit-tests/varmod-localtime.exp
diff -u src/usr.bin/make/unit-tests/varmod-localtime.exp:1.16 src/usr.bin/make/unit-tests/varmod-localtime.exp:1.17
--- src/usr.bin/make/unit-tests/varmod-localtime.exp:1.16 Thu Jul 4 20:18:40 2024
+++ src/usr.bin/make/unit-tests/varmod-localtime.exp Fri Jul 5 19:47:22 2024
@@ -1,10 +1,10 @@
-make: "varmod-localtime.mk" line 61: while evaluating "${:L:localtime=-1} != """: Invalid time value "-1"
+make: "varmod-localtime.mk" line 61: while evaluating "${:L:localtime=-1} != """ with value "": Invalid time value "-1"
make: "varmod-localtime.mk" line 61: Malformed conditional (${:L:localtime=-1} != "")
-make: "varmod-localtime.mk" line 72: while evaluating "${:L:localtime= 1} != """: Invalid time value " 1"
+make: "varmod-localtime.mk" line 72: while evaluating "${:L:localtime= 1} != """ with value "": Invalid time value " 1"
make: "varmod-localtime.mk" line 72: Malformed conditional (${:L:localtime= 1} != "")
-make: "varmod-localtime.mk" line 120: while evaluating "${:L:localtime=10000000000000000000000000000000} != """: Invalid time value "10000000000000000000000000000000"
+make: "varmod-localtime.mk" line 120: while evaluating "${:L:localtime=10000000000000000000000000000000} != """ with value "": Invalid time value "10000000000000000000000000000000"
make: "varmod-localtime.mk" line 120: Malformed conditional (${:L:localtime=10000000000000000000000000000000} != "")
-make: "varmod-localtime.mk" line 133: while evaluating "${:L:localtime=error} != """: Invalid time value "error"
+make: "varmod-localtime.mk" line 133: while evaluating "${:L:localtime=error} != """ with value "": Invalid time value "error"
make: "varmod-localtime.mk" line 133: Malformed conditional (${:L:localtime=error} != "")
make: "varmod-localtime.mk" line 144: while evaluating variable "%Y" with value "%Y": Invalid time value "100000S,1970,bad,"
make: "varmod-localtime.mk" line 144: Malformed conditional (${%Y:L:localtime=100000S,1970,bad,} != "bad")
Index: src/usr.bin/make/unit-tests/varmod-localtime.mk
diff -u src/usr.bin/make/unit-tests/varmod-localtime.mk:1.16 src/usr.bin/make/unit-tests/varmod-localtime.mk:1.17
--- src/usr.bin/make/unit-tests/varmod-localtime.mk:1.16 Thu Jul 4 17:47:54 2024
+++ src/usr.bin/make/unit-tests/varmod-localtime.mk Fri Jul 5 19:47:22 2024
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-localtime.mk,v 1.16 2024/07/04 17:47:54 rillig Exp $
+# $NetBSD: varmod-localtime.mk,v 1.17 2024/07/05 19:47:22 rillig Exp $
#
# Tests for the :localtime variable modifier, which formats a timestamp
# using strftime(3) in local time.
@@ -56,7 +56,7 @@
# 1970. Going back 50 years in the past is not a practical use case for
# make. Therefore, since var.c 1.631, negative time stamps produce a
# parse error.
-# expect+2: while evaluating "${:L:localtime=-1} != """: Invalid time value "-1"
+# expect+2: while evaluating "${:L:localtime=-1} != """ with value "": Invalid time value "-1"
# expect+1: Malformed conditional (${:L:localtime=-1} != "")
.if ${:L:localtime=-1} != ""
. error
@@ -67,7 +67,7 @@
# Spaces were allowed before var.c 1.631 from 2020-10-31 21:40:20, not
# because it would make sense but just as a side-effect from using strtoul.
-# expect+2: while evaluating "${:L:localtime= 1} != """: Invalid time value " 1"
+# expect+2: while evaluating "${:L:localtime= 1} != """ with value "": Invalid time value " 1"
# expect+1: Malformed conditional (${:L:localtime= 1} != "")
.if ${:L:localtime= 1} != ""
. error
@@ -115,7 +115,7 @@
#
# Since var.c 1.631 from 2020-10-31, the overflow is detected and produces a
# parse error.
-# expect+2: while evaluating "${:L:localtime=10000000000000000000000000000000} != """: Invalid time value "10000000000000000000000000000000"
+# expect+2: while evaluating "${:L:localtime=10000000000000000000000000000000} != """ with value "": Invalid time value "10000000000000000000000000000000"
# expect+1: Malformed conditional (${:L:localtime=10000000000000000000000000000000} != "")
.if ${:L:localtime=10000000000000000000000000000000} != ""
. error
@@ -128,7 +128,7 @@
# stopped after the '=', and the remaining string was parsed for more variable
# modifiers. Because of the unknown modifier 'e' from the 'error', the whole
# variable value was discarded and thus not printed.
-# expect+2: while evaluating "${:L:localtime=error} != """: Invalid time value "error"
+# expect+2: while evaluating "${:L:localtime=error} != """ with value "": Invalid time value "error"
# expect+1: Malformed conditional (${:L:localtime=error} != "")
.if ${:L:localtime=error} != ""
. error
Index: src/usr.bin/make/unit-tests/varparse-errors.mk
diff -u src/usr.bin/make/unit-tests/varparse-errors.mk:1.16 src/usr.bin/make/unit-tests/varparse-errors.mk:1.17
--- src/usr.bin/make/unit-tests/varparse-errors.mk:1.16 Fri Jul 5 18:59:33 2024
+++ src/usr.bin/make/unit-tests/varparse-errors.mk Fri Jul 5 19:47:22 2024
@@ -1,4 +1,4 @@
-# $NetBSD: varparse-errors.mk,v 1.16 2024/07/05 18:59:33 rillig Exp $
+# $NetBSD: varparse-errors.mk,v 1.17 2024/07/05 19:47:22 rillig Exp $
# Tests for parsing and evaluating all kinds of expressions.
#
@@ -34,7 +34,7 @@ ERR_EVAL= An evaluation error ${:Uvalue:
# As of 2020-12-01, errors in the variable name are silently ignored.
# Since var.c 1.754 from 2020-12-20, unknown modifiers at parse time result
# in an error message and a non-zero exit status.
-# expect+1: while evaluating "${:U:Z}": Unknown modifier "Z"
+# expect+1: while evaluating "${:U:Z}" with value "": Unknown modifier "Z"
VAR.${:U:Z}= unknown modifier in the variable name
.if ${VAR.} != "unknown modifier in the variable name"
. error
@@ -43,7 +43,7 @@ VAR.${:U:Z}= unknown modifier in the var
# As of 2020-12-01, errors in the variable name are silently ignored.
# Since var.c 1.754 from 2020-12-20, unknown modifiers at parse time result
# in an error message and a non-zero exit status.
-# expect+1: while evaluating "${:U:Z}post": Unknown modifier "Z"
+# expect+1: while evaluating "${:U:Z}post" with value "": Unknown modifier "Z"
VAR.${:U:Z}post= unknown modifier with text in the variable name
.if ${VAR.post} != "unknown modifier with text in the variable name"
. error
@@ -66,12 +66,12 @@ VAR.${:U:Z}post= unknown modifier with t
#
#.MAKEFLAGS: -dv
IND= ${:OX}
-# expect+6: while evaluating "${:U:OX:U${IND}} ${:U:OX:U${IND}}": Bad modifier ":OX"
-# expect+5: while evaluating "${:U:OX:U${IND}}": Bad modifier ":OX"
+# expect+6: while evaluating "${:U:OX:U${IND}} ${:U:OX:U${IND}}" with value "": Bad modifier ":OX"
+# expect+5: while evaluating "${:U:OX:U${IND}}" with value "": Bad modifier ":OX"
# expect+4: Undefined variable "${:U:OX"
-# expect+3: while evaluating variable "IND" with value "${:OX}": while evaluating "${:OX}": Bad modifier ":OX"
+# expect+3: while evaluating variable "IND" with value "${:OX}": while evaluating "${:OX}" with value "": Bad modifier ":OX"
# expect+2: Undefined variable "${:U:OX"
-# expect+1: while evaluating variable "IND" with value "${:OX}": while evaluating "${:OX}": Bad modifier ":OX"
+# expect+1: while evaluating variable "IND" with value "${:OX}": while evaluating "${:OX}" with value "": Bad modifier ":OX"
_:= ${:U:OX:U${IND}} ${:U:OX:U${IND}}
#.MAKEFLAGS: -d0
@@ -79,31 +79,31 @@ _:= ${:U:OX:U${IND}} ${:U:OX:U${IND}}
# Before var.c 1.032 from 2022-08-24, make complained about 'Unknown modifier'
# or 'Bad modifier' when in fact the modifier was entirely correct, it was
# just not delimited by either ':' or '}' but instead by '\0'.
-# expect+1: while evaluating "${:U:Q": Unclosed expression, expecting '}' for modifier "Q"
+# expect+1: while evaluating "${:U:Q" with value "": Unclosed expression, expecting '}' for modifier "Q"
UNCLOSED:= ${:U:Q
-# expect+1: while evaluating "${:U:sh": Unclosed expression, expecting '}' for modifier "sh"
+# expect+1: while evaluating "${:U:sh" with value "": Unclosed expression, expecting '}' for modifier "sh"
UNCLOSED:= ${:U:sh
-# expect+1: while evaluating "${:U:tA": Unclosed expression, expecting '}' for modifier "tA"
+# expect+1: while evaluating "${:U:tA" with value "": Unclosed expression, expecting '}' for modifier "tA"
UNCLOSED:= ${:U:tA
-# expect+1: while evaluating "${:U:tsX": Unclosed expression, expecting '}' for modifier "tsX"
+# expect+1: while evaluating "${:U:tsX" with value "": Unclosed expression, expecting '}' for modifier "tsX"
UNCLOSED:= ${:U:tsX
-# expect+1: while evaluating "${:U:ts": Unclosed expression, expecting '}' for modifier "ts"
+# expect+1: while evaluating "${:U:ts" with value "": Unclosed expression, expecting '}' for modifier "ts"
UNCLOSED:= ${:U:ts
-# expect+1: while evaluating "${:U:ts\040": Unclosed expression, expecting '}' for modifier "ts\040"
+# expect+1: while evaluating "${:U:ts\040" with value "": Unclosed expression, expecting '}' for modifier "ts\040"
UNCLOSED:= ${:U:ts\040
-# expect+1: while evaluating "${:U:u": Unclosed expression, expecting '}' for modifier "u"
+# expect+1: while evaluating "${:U:u" with value "": Unclosed expression, expecting '}' for modifier "u"
UNCLOSED:= ${:U:u
-# expect+1: while evaluating "${:U:H": Unclosed expression, expecting '}' for modifier "H"
+# expect+1: while evaluating "${:U:H" with value ".": Unclosed expression, expecting '}' for modifier "H"
UNCLOSED:= ${:U:H
-# expect+1: while evaluating "${:U:[1]": Unclosed expression, expecting '}' for modifier "[1]"
+# expect+1: while evaluating "${:U:[1]" with value "": Unclosed expression, expecting '}' for modifier "[1]"
UNCLOSED:= ${:U:[1]
-# expect+1: while evaluating "${:U:hash": Unclosed expression, expecting '}' for modifier "hash"
+# expect+1: while evaluating "${:U:hash" with value "b2af338b": Unclosed expression, expecting '}' for modifier "hash"
UNCLOSED:= ${:U:hash
-# expect+1: while evaluating "${:U:range": Unclosed expression, expecting '}' for modifier "range"
+# expect+1: while evaluating "${:U:range" with value "1": Unclosed expression, expecting '}' for modifier "range"
UNCLOSED:= ${:U:range
-# expect+1: while evaluating "${:U:_": Unclosed expression, expecting '}' for modifier "_"
+# expect+1: while evaluating "${:U:_" with value "": Unclosed expression, expecting '}' for modifier "_"
UNCLOSED:= ${:U:_
-# expect+1: while evaluating "${:U:gmtime": Unclosed expression, expecting '}' for modifier "gmtime"
+# expect+1: while evaluating "${:U:gmtime" with value "<timestamp>": Unclosed expression, expecting '}' for modifier "gmtime"
UNCLOSED:= ${:U:gmtime
-# expect+1: while evaluating "${:U:localtime": Unclosed expression, expecting '}' for modifier "localtime"
+# expect+1: while evaluating "${:U:localtime" with value "<timestamp>": Unclosed expression, expecting '}' for modifier "localtime"
UNCLOSED:= ${:U:localtime
Index: src/usr.bin/make/unit-tests/varmod-loop-delete.mk
diff -u src/usr.bin/make/unit-tests/varmod-loop-delete.mk:1.5 src/usr.bin/make/unit-tests/varmod-loop-delete.mk:1.6
--- src/usr.bin/make/unit-tests/varmod-loop-delete.mk:1.5 Thu Jul 4 17:47:54 2024
+++ src/usr.bin/make/unit-tests/varmod-loop-delete.mk Fri Jul 5 19:47:22 2024
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-loop-delete.mk,v 1.5 2024/07/04 17:47:54 rillig Exp $
+# $NetBSD: varmod-loop-delete.mk,v 1.6 2024/07/05 19:47:22 rillig Exp $
#
# Tests for the variable modifier ':@', which as a side effect allows to
# delete an arbitrary variable.
@@ -16,7 +16,7 @@ VAR= ${:U:@VAR@@} rest of the value
# In an assignment, the scope is 'Global'. Since the variable 'VAR' is
# defined in the global scope, it deletes itself.
-# expect+1: while evaluating variable "VAR" with value "${:U:@VAR@@} rest of the value": while evaluating "${:U:@VAR@@} rest of the value": Cannot delete variable "VAR" while it is used
+# expect+1: while evaluating variable "VAR" with value "${:U:@VAR@@} rest of the value": while evaluating "${:U:@VAR@@} rest of the value" with value "": Cannot delete variable "VAR" while it is used
EVAL:= ${VAR}
.if ${EVAL} != " rest of the value"
. error
Index: src/usr.bin/make/unit-tests/varmod-subst.exp
diff -u src/usr.bin/make/unit-tests/varmod-subst.exp:1.5 src/usr.bin/make/unit-tests/varmod-subst.exp:1.6
--- src/usr.bin/make/unit-tests/varmod-subst.exp:1.5 Sat Apr 20 10:18:55 2024
+++ src/usr.bin/make/unit-tests/varmod-subst.exp Fri Jul 5 19:47:22 2024
@@ -45,7 +45,7 @@ mod-subst-delimiter:
1 two 3 tilde
mod-subst-chain:
A B c.
-make: in target "mod-subst-chain": while evaluating "${:Uvalue:S,a,x,i}.": Unknown modifier "i"
+make: in target "mod-subst-chain": while evaluating "${:Uvalue:S,a,x,i}." with value "vxlue": Unknown modifier "i"
.
mod-subst-dollar:$1:
mod-subst-dollar:$2:
Index: src/usr.bin/make/unit-tests/varmod-loop-varname.exp
diff -u src/usr.bin/make/unit-tests/varmod-loop-varname.exp:1.9 src/usr.bin/make/unit-tests/varmod-loop-varname.exp:1.10
--- src/usr.bin/make/unit-tests/varmod-loop-varname.exp:1.9 Thu Jul 4 20:18:40 2024
+++ src/usr.bin/make/unit-tests/varmod-loop-varname.exp Fri Jul 5 19:47:22 2024
@@ -1,4 +1,4 @@
-make: "varmod-loop-varname.mk" line 18: while evaluating "${:Uone two three:@${:Ubar:S,b,v,}@+${var}+@} != "+one+ +two+ +three+"": In the :@ modifier, the variable name "${:Ubar:S,b,v,}" must not contain a dollar
+make: "varmod-loop-varname.mk" line 18: while evaluating "${:Uone two three:@${:Ubar:S,b,v,}@+${var}+@} != "+one+ +two+ +three+"" with value "one two three": In the :@ modifier, the variable name "${:Ubar:S,b,v,}" must not contain a dollar
make: "varmod-loop-varname.mk" line 18: Malformed conditional (${:Uone two three:@${:Ubar:S,b,v,}@+${var}+@} != "+one+ +two+ +three+")
make: "varmod-loop-varname.mk" line 89: while evaluating variable "1 2 3" with value "1 2 3": In the :@ modifier, the variable name "v$" must not contain a dollar
make: "varmod-loop-varname.mk" line 89: Malformed conditional (${1 2 3:L:@v$@($v)@} != "(1) (2) (3)")
Index: src/usr.bin/make/unit-tests/varmod-shell.mk
diff -u src/usr.bin/make/unit-tests/varmod-shell.mk:1.9 src/usr.bin/make/unit-tests/varmod-shell.mk:1.10
--- src/usr.bin/make/unit-tests/varmod-shell.mk:1.9 Sun Jun 30 11:37:21 2024
+++ src/usr.bin/make/unit-tests/varmod-shell.mk Fri Jul 5 19:47:22 2024
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-shell.mk,v 1.9 2024/06/30 11:37:21 rillig Exp $
+# $NetBSD: varmod-shell.mk,v 1.10 2024/07/05 19:47:22 rillig Exp $
#
# Tests for the ':!cmd!' variable modifier, which runs the shell command
# given by the variable modifier and returns its output.
@@ -21,18 +21,18 @@
# Between 2000-04-29 and 2020-11-17, the error message mentioned the previous
# value of the expression (which is usually an empty string) instead of the
# command that was executed.
-# expect+1: warning: while evaluating "${:!echo word; (exit 13)!} != "word"": Command "echo word; (exit 13)" exited with status 13
+# expect+1: warning: while evaluating "${:!echo word; (exit 13)!} != "word"" with value "word": Command "echo word; (exit 13)" exited with status 13
.if ${:!echo word; (exit 13)!} != "word"
. error
.endif
-# expect+1: warning: while evaluating "${:Uprevious value:!echo word; (exit 13)!} != "word"": Command "echo word; (exit 13)" exited with status 13
+# expect+1: warning: while evaluating "${:Uprevious value:!echo word; (exit 13)!} != "word"" with value "word": Command "echo word; (exit 13)" exited with status 13
.if ${:Uprevious value:!echo word; (exit 13)!} != "word"
. error
.endif
.MAKEFLAGS: -dv # to see the "Capturing" debug output
-# expect+1: warning: while evaluating "${:!echo word; ${:U(exit 13)}!}": Command "echo word; (exit 13)" exited with status 13
+# expect+1: warning: while evaluating "${:!echo word; ${:U(exit 13)}!}" with value "word": Command "echo word; (exit 13)" exited with status 13
_:= ${:!echo word; ${:U(exit 13)}!}
.MAKEFLAGS: -d0
Index: src/usr.bin/make/unit-tests/varmod-subst-regex.exp
diff -u src/usr.bin/make/unit-tests/varmod-subst-regex.exp:1.9 src/usr.bin/make/unit-tests/varmod-subst-regex.exp:1.10
--- src/usr.bin/make/unit-tests/varmod-subst-regex.exp:1.9 Thu Jul 4 17:47:54 2024
+++ src/usr.bin/make/unit-tests/varmod-subst-regex.exp Fri Jul 5 19:47:22 2024
@@ -1,26 +1,26 @@
-make: in target "mod-regex-compile-error": while evaluating "${:Uword1 word2:C,****,____,g:C,word,____,:Q}.": Regex compilation error: (details omitted)
+make: in target "mod-regex-compile-error": while evaluating "${:Uword1 word2:C,****,____,g:C,word,____,:Q}." with value "word1 word2": Regex compilation error: (details omitted)
mod-regex-compile-error: C,word,____,:Q}.
-make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,..,\1\1,:Q}": No subexpression \1
-make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,..,\1\1,:Q}": No subexpression \1
-make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,..,\1\1,:Q}": No subexpression \1
-make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,..,\1\1,:Q}": No subexpression \1
+make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,..,\1\1,:Q}" with value "1 23 456": No subexpression \1
+make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,..,\1\1,:Q}" with value "1 23 456": No subexpression \1
+make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,..,\1\1,:Q}" with value "1 23 456": No subexpression \1
+make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,..,\1\1,:Q}" with value "1 23 456": No subexpression \1
mod-regex-limits:11-missing:1 6
mod-regex-limits:11-ok:1 22 446
-make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,..,\2\2,:Q}": No subexpression \2
-make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,..,\2\2,:Q}": No subexpression \2
-make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,..,\2\2,:Q}": No subexpression \2
-make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,..,\2\2,:Q}": No subexpression \2
+make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,..,\2\2,:Q}" with value "1 23 456": No subexpression \2
+make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,..,\2\2,:Q}" with value "1 23 456": No subexpression \2
+make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,..,\2\2,:Q}" with value "1 23 456": No subexpression \2
+make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,..,\2\2,:Q}" with value "1 23 456": No subexpression \2
mod-regex-limits:22-missing:1 6
-make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,(.).,\2\2,:Q}": No subexpression \2
-make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,(.).,\2\2,:Q}": No subexpression \2
-make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,(.).,\2\2,:Q}": No subexpression \2
-make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,(.).,\2\2,:Q}": No subexpression \2
+make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,(.).,\2\2,:Q}" with value "1 23 456": No subexpression \2
+make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,(.).,\2\2,:Q}" with value "1 23 456": No subexpression \2
+make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,(.).,\2\2,:Q}" with value "1 23 456": No subexpression \2
+make: in target "mod-regex-limits": while evaluating "${:U1 23 456:C,(.).,\2\2,:Q}" with value "1 23 456": No subexpression \2
mod-regex-limits:22-missing:1 6
mod-regex-limits:22-ok:1 33 556
mod-regex-limits:capture:ihgfedcbaabcdefghijABCDEFGHIJa0a1a2rest
make: in target "mod-regex-errors": while evaluating variable "UNDEF" with value "value": Regex compilation error: (details omitted)
mod-regex-errors:
-make: in target "mod-regex-errors": while evaluating variable "word" with value "word": while evaluating "${:U:Z}y,W}": Unknown modifier "Z"
+make: in target "mod-regex-errors": while evaluating variable "word" with value "word": while evaluating "${:U:Z}y,W}" with value "": Unknown modifier "Z"
mod-regex-errors: xy
unmatched-subexpression.ok: one one 2 3 5 8 one3 2one 34
make: No match for subexpression \2
Index: src/usr.bin/make/unit-tests/varmod-loop-varname.mk
diff -u src/usr.bin/make/unit-tests/varmod-loop-varname.mk:1.8 src/usr.bin/make/unit-tests/varmod-loop-varname.mk:1.9
--- src/usr.bin/make/unit-tests/varmod-loop-varname.mk:1.8 Thu Jul 4 17:47:54 2024
+++ src/usr.bin/make/unit-tests/varmod-loop-varname.mk Fri Jul 5 19:47:22 2024
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-loop-varname.mk,v 1.8 2024/07/04 17:47:54 rillig Exp $
+# $NetBSD: varmod-loop-varname.mk,v 1.9 2024/07/05 19:47:22 rillig Exp $
#
# Tests for the first part of the variable modifier ':@var@...@', which
# contains the variable name to use during the loop.
@@ -13,7 +13,7 @@
# dynamically. There was no practical use-case for this.
# Since var.c 1.907 from 2021-04-04, a '$' is no longer allowed in the
# variable name.
-# expect+2: while evaluating "${:Uone two three:@${:Ubar:S,b,v,}@+${var}+@} != "+one+ +two+ +three+"": In the :@ modifier, the variable name "${:Ubar:S,b,v,}" must not contain a dollar
+# expect+2: while evaluating "${:Uone two three:@${:Ubar:S,b,v,}@+${var}+@} != "+one+ +two+ +three+"" with value "one two three": In the :@ modifier, the variable name "${:Ubar:S,b,v,}" must not contain a dollar
# expect+1: Malformed conditional (${:Uone two three:@${:Ubar:S,b,v,}@+${var}+@} != "+one+ +two+ +three+")
.if ${:Uone two three:@${:Ubar:S,b,v,}@+${var}+@} != "+one+ +two+ +three+"
. error
Index: src/usr.bin/make/unit-tests/varmod-match-escape.mk
diff -u src/usr.bin/make/unit-tests/varmod-match-escape.mk:1.15 src/usr.bin/make/unit-tests/varmod-match-escape.mk:1.16
--- src/usr.bin/make/unit-tests/varmod-match-escape.mk:1.15 Thu Jul 4 17:47:54 2024
+++ src/usr.bin/make/unit-tests/varmod-match-escape.mk Fri Jul 5 19:47:22 2024
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-match-escape.mk,v 1.15 2024/07/04 17:47:54 rillig Exp $
+# $NetBSD: varmod-match-escape.mk,v 1.16 2024/07/05 19:47:22 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
@@ -65,7 +65,7 @@ VALUES= : :: :\:
# In lint mode, the case of a lonely '$' is covered with an error message.
.MAKEFLAGS: -dL
-# expect+1: while evaluating "${:U\$:M\$} != """: Dollar followed by nothing
+# expect+1: while evaluating "${:U\$:M\$} != """ with value "$": Dollar followed by nothing
.if ${:U\$:M\$} != ""
. error
.endif
Index: src/usr.bin/make/unit-tests/varmod-to-separator.exp
diff -u src/usr.bin/make/unit-tests/varmod-to-separator.exp:1.15 src/usr.bin/make/unit-tests/varmod-to-separator.exp:1.16
--- src/usr.bin/make/unit-tests/varmod-to-separator.exp:1.15 Thu Jul 4 18:53:37 2024
+++ src/usr.bin/make/unit-tests/varmod-to-separator.exp Fri Jul 5 19:47:22 2024
@@ -20,9 +20,9 @@ make: "varmod-to-separator.mk" line 240:
make: "varmod-to-separator.mk" line 240: Malformed conditional (${WORDS:ts\X})
make: "varmod-to-separator.mk" line 250: while evaluating variable "WORDS" with value "one two three four five six": Bad modifier ":t\X"
make: "varmod-to-separator.mk" line 250: Malformed conditional (${WORDS:t\X} != "anything")
-make: "varmod-to-separator.mk" line 267: while evaluating "${:Ua b:ts\69}": Bad modifier ":ts\69"
+make: "varmod-to-separator.mk" line 267: while evaluating "${:Ua b:ts\69}" with value "a b": Bad modifier ":ts\69"
make: "varmod-to-separator.mk" line 267: Malformed conditional (${:Ua b:ts\69})
-make: "varmod-to-separator.mk" line 276: while evaluating "${:Ua b:ts\x1F60E}": Invalid character number at "1F60E}"
+make: "varmod-to-separator.mk" line 276: while evaluating "${:Ua b:ts\x1F60E}" with value "a b": Invalid character number at "1F60E}"
make: "varmod-to-separator.mk" line 276: Malformed conditional (${:Ua b:ts\x1F60E})
make: Fatal errors encountered -- cannot continue
make: stopped in unit-tests
Index: src/usr.bin/make/unit-tests/varmod-shell.exp
diff -u src/usr.bin/make/unit-tests/varmod-shell.exp:1.7 src/usr.bin/make/unit-tests/varmod-shell.exp:1.8
--- src/usr.bin/make/unit-tests/varmod-shell.exp:1.7 Sun Jun 30 11:37:21 2024
+++ src/usr.bin/make/unit-tests/varmod-shell.exp Fri Jul 5 19:47:22 2024
@@ -1,11 +1,11 @@
-make: "varmod-shell.mk" line 25: warning: while evaluating "${:!echo word; (exit 13)!} != "word"": Command "echo word; (exit 13)" exited with status 13
-make: "varmod-shell.mk" line 29: warning: while evaluating "${:Uprevious value:!echo word; (exit 13)!} != "word"": Command "echo word; (exit 13)" exited with status 13
+make: "varmod-shell.mk" line 25: warning: while evaluating "${:!echo word; (exit 13)!} != "word"" with value "word": Command "echo word; (exit 13)" exited with status 13
+make: "varmod-shell.mk" line 29: warning: while evaluating "${:Uprevious value:!echo word; (exit 13)!} != "word"" with value "word": Command "echo word; (exit 13)" exited with status 13
Global: _ = # (empty)
Var_Parse: ${:!echo word; ${:U(exit 13)}!} (eval-keep-dollar-and-undefined)
Evaluating modifier ${:!...} on value "" (eval-keep-dollar-and-undefined, undefined)
Modifier part: "echo word; (exit 13)"
Capturing the output of command "echo word; (exit 13)"
-make: "varmod-shell.mk" line 36: warning: while evaluating "${:!echo word; ${:U(exit 13)}!}": Command "echo word; (exit 13)" exited with status 13
+make: "varmod-shell.mk" line 36: warning: while evaluating "${:!echo word; ${:U(exit 13)}!}" with value "word": Command "echo word; (exit 13)" exited with status 13
Result of ${:!echo word; ${:U(exit 13)}!} is "word" (eval-keep-dollar-and-undefined, defined)
Global: _ = word
Global: .MAKEFLAGS = -r -k -d v -d