Module Name: src Committed By: rillig Date: Thu Jul 30 13:50:27 UTC 2020
Modified Files: src/usr.bin/make/unit-tests: varmisc.exp varmisc.mk Log Message: make(1): add test for indirect unclosed variable The error message mentions only the original variable name right now. It's left to the Makefile author to see where the actual unclosed variable value comes from. From a usability standpoint that's not optimal, but everything else would need additional cycles even in the good cases, or it might have side-effects when evaluating a variable twice (once to detect the error, and a second time to find out the details of the error). To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/usr.bin/make/unit-tests/varmisc.exp cvs rdiff -u -r1.19 -r1.20 src/usr.bin/make/unit-tests/varmisc.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/unit-tests/varmisc.exp diff -u src/usr.bin/make/unit-tests/varmisc.exp:1.14 src/usr.bin/make/unit-tests/varmisc.exp:1.15 --- src/usr.bin/make/unit-tests/varmisc.exp:1.14 Tue Jul 28 17:18:40 2020 +++ src/usr.bin/make/unit-tests/varmisc.exp Thu Jul 30 13:50:27 2020 @@ -66,5 +66,7 @@ make: Unclosed variable "UNCLOSED.2" make: Unclosed variable "UNCLOSED.3" +make: Unclosed variable "UNCLOSED_ORIG" + varerror-unclosed:end exit status 0 Index: src/usr.bin/make/unit-tests/varmisc.mk diff -u src/usr.bin/make/unit-tests/varmisc.mk:1.19 src/usr.bin/make/unit-tests/varmisc.mk:1.20 --- src/usr.bin/make/unit-tests/varmisc.mk:1.19 Tue Jul 28 19:39:43 2020 +++ src/usr.bin/make/unit-tests/varmisc.mk Thu Jul 30 13:50:27 2020 @@ -1,4 +1,4 @@ -# $Id: varmisc.mk,v 1.19 2020/07/28 19:39:43 rillig Exp $ +# $Id: varmisc.mk,v 1.20 2020/07/30 13:50:27 rillig Exp $ # # Miscellaneous variable tests. @@ -194,6 +194,10 @@ parse-dynamic: # Since 2020-07-28, make complains about unclosed variables. # Before that, it had not complained about unclosed variables only when # parsing the modifiers, but not when parsing the variable name. + +UNCLOSED_INDIR_1= ${UNCLOSED_ORIG +UNCLOSED_INDIR_2= ${UNCLOSED_INDIR_1} + varerror-unclosed: @echo $@:begin @echo $( @@ -205,6 +209,7 @@ varerror-unclosed: .for i in 1 2 3 @echo ${UNCLOSED.${i} .endfor + @echo ${UNCLOSED_INDIR_2} @echo $@:end # As of 2020-07-28, .undef only undefines the first variable.