Module Name: src Committed By: rillig Date: Thu Jul 2 09:44:51 UTC 2020
Modified Files: src/usr.bin/make/unit-tests: varmisc.mk Log Message: make(1): document the actual cause for "recursive variable" That wrong error message had nothing to do with the .for loop, it was only caused because the .for loop uses the :U modifier internally. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 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.mk diff -u src/usr.bin/make/unit-tests/varmisc.mk:1.9 src/usr.bin/make/unit-tests/varmisc.mk:1.10 --- src/usr.bin/make/unit-tests/varmisc.mk:1.9 Wed Jul 1 18:02:26 2020 +++ src/usr.bin/make/unit-tests/varmisc.mk Thu Jul 2 09:44:51 2020 @@ -1,4 +1,4 @@ -# $Id: varmisc.mk,v 1.9 2020/07/01 18:02:26 sjg Exp $ +# $Id: varmisc.mk,v 1.10 2020/07/02 09:44:51 rillig Exp $ # # Miscellaneous variable tests. @@ -72,3 +72,13 @@ MAN+= ${MAN$s} manok: @echo MAN=${MAN} + +# This is an expanded variant of the above .for loop. +# Between 2020-08-28 and 2020-07-02 this paragraph generated a wrong +# error message "Variable VARNAME is recursive". +# When evaluating the !empty expression, the ${:U1} was not expanded and +# thus resulted in the seeming definition VARNAME=${VARNAME}, which is +# obviously recursive. +VARNAME= ${VARNAME${:U1}} +.if defined(VARNAME${:U2}) && !empty(VARNAME${:U2}) +.endif