Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make/unit-tests make(1): document the actual cause f...



details:   https://anonhg.NetBSD.org/src/rev/7875d938d7a7
branches:  trunk
changeset: 935404:7875d938d7a7
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Jul 02 09:44:51 2020 +0000

description:
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.

diffstat:

 usr.bin/make/unit-tests/varmisc.mk |  12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diffs (23 lines):

diff -r 7c0ea6698bbb -r 7875d938d7a7 usr.bin/make/unit-tests/varmisc.mk
--- a/usr.bin/make/unit-tests/varmisc.mk        Thu Jul 02 09:07:24 2020 +0000
+++ b/usr.bin/make/unit-tests/varmisc.mk        Thu Jul 02 09:44:51 2020 +0000
@@ -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 @@
 
 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



Home | Main Index | Thread Index | Old Index