aboutsummaryrefslogtreecommitdiff
path: root/unit-tests/cond-token-plain.mk
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2020-11-20 03:54:37 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2020-11-20 03:54:37 +0000
commit1b65f0bd2bda7121a90f8cb4c1cacaa20f1b681d (patch)
tree90c374b8513ec5109e1ec4e2228e2edf648e8756 /unit-tests/cond-token-plain.mk
parent302da1a3d35c15cb29d76e0a939f8bcb13f7ad80 (diff)
downloadsrc-9ea923884d3be654375c298dcc5124391ec21db5.tar.gz
src-9ea923884d3be654375c298dcc5124391ec21db5.zip
Diffstat (limited to 'unit-tests/cond-token-plain.mk')
-rw-r--r--unit-tests/cond-token-plain.mk13
1 files changed, 8 insertions, 5 deletions
diff --git a/unit-tests/cond-token-plain.mk b/unit-tests/cond-token-plain.mk
index ba9934f5b882..a5ffa37a5c84 100644
--- a/unit-tests/cond-token-plain.mk
+++ b/unit-tests/cond-token-plain.mk
@@ -1,4 +1,4 @@
-# $NetBSD: cond-token-plain.mk,v 1.4 2020/09/12 17:47:24 rillig Exp $
+# $NetBSD: cond-token-plain.mk,v 1.6 2020/11/15 14:58:14 rillig Exp $
#
# Tests for plain tokens (that is, string literals without quotes)
# in .if conditions.
@@ -14,7 +14,7 @@
# parser gets to see it.
#
# XXX: The error message is missing for this malformed condition.
-# The right-hand side of the comparison is just a '"'.
+# The right-hand side of the comparison is just a '"', before unescaping.
.if ${:U} != "#hash"
. error
.endif
@@ -31,16 +31,19 @@
# comment handling anymore. The comments are supposed to be stripped off
# in a very early parsing phase.
#
+# See https://gnats.netbsd.org/19596 for example makefiles demonstrating the
+# original problems. This workaround is probably not needed anymore.
+#
# XXX: Missing error message for the malformed condition. The right-hand
-# side is double-quotes, backslash, backslash.
-# XXX: It is unexpected that the right-hand side evaluates to a single
-# backslash.
+# side before unescaping is double-quotes, backslash, backslash.
.if ${:U\\} != "\\#hash"
. error
.endif
# The right-hand side of a comparison is not parsed as a token, therefore
# the code from CondParser_Token does not apply to it.
+# TODO: Explain the consequences.
+# TODO: Does this mean that more syntactic variants are allowed here?
.if ${:U\#hash} != \#hash
. error
.endif