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 handling of irrele...



details:   https://anonhg.NetBSD.org/src/rev/fb6b1cb0f8f3
branches:  trunk
changeset: 957537:fb6b1cb0f8f3
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Dec 01 19:37:23 2020 +0000

description:
make(1): document handling of irrelevant conditions before 2020-07-09

diffstat:

 usr.bin/make/unit-tests/cond-short.mk |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (23 lines):

diff -r 8bd37c2564af -r fb6b1cb0f8f3 usr.bin/make/unit-tests/cond-short.mk
--- a/usr.bin/make/unit-tests/cond-short.mk     Tue Dec 01 19:33:50 2020 +0000
+++ b/usr.bin/make/unit-tests/cond-short.mk     Tue Dec 01 19:37:23 2020 +0000
@@ -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 @@
 .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



Home | Main Index | Thread Index | Old Index