Module Name: src
Committed By: rillig
Date: Tue Dec 1 19:37:23 UTC 2020
Modified Files:
src/usr.bin/make/unit-tests: cond-short.mk
Log Message:
make(1): document handling of irrelevant conditions before 2020-07-09
To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.bin/make/unit-tests/cond-short.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/cond-short.mk
diff -u src/usr.bin/make/unit-tests/cond-short.mk:1.14 src/usr.bin/make/unit-tests/cond-short.mk:1.15
--- src/usr.bin/make/unit-tests/cond-short.mk:1.14 Tue Dec 1 19:33:50 2020
+++ src/usr.bin/make/unit-tests/cond-short.mk Tue Dec 1 19:37:23 2020
@@ -1,4 +1,4 @@
-# $NetBSD: cond-short.mk,v 1.14 2020/12/01 19:33:50 rillig Exp $
+# $NetBSD: cond-short.mk,v 1.15 2020/12/01 19:37:23 rillig Exp $
#
# Demonstrates that in conditions, the right-hand side of an && or ||
# is only evaluated if it can actually influence the result.
@@ -200,9 +200,10 @@ x= Fail
.endif
x!= echo '0 || $${iV2:U2} < $${V42}: $x' >&2; echo
-# TODO: Has this always worked? There may have been a time, maybe around
-# 2000, when make would complain about the "Malformed conditional" because
-# UNDEF is not defined.
+# The right-hand side of the '&&' is irrelevant since the left-hand side
+# already evaluates to false. Before cond.c 1.79 from 2020-07-09, it was
+# expanded nevertheless, although with a small modification: undefined
+# variables may be used in these expressions without generating an error.
.if defined(UNDEF) && ${UNDEF} != "undefined"
. error
.endif