Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make make(1): document handling of '#' and '\n' in c...



details:   https://anonhg.NetBSD.org/src/rev/d79207747384
branches:  trunk
changeset: 956889:d79207747384
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Nov 09 00:07:06 2020 +0000

description:
make(1): document handling of '#' and '\n' in conditionals

diffstat:

 usr.bin/make/cond.c                         |  9 +++++----
 usr.bin/make/unit-tests/cond-token-plain.mk |  5 ++++-
 2 files changed, 9 insertions(+), 5 deletions(-)

diffs (49 lines):

diff -r 8840b1804606 -r d79207747384 usr.bin/make/cond.c
--- a/usr.bin/make/cond.c       Sun Nov 08 23:54:28 2020 +0000
+++ b/usr.bin/make/cond.c       Mon Nov 09 00:07:06 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cond.c,v 1.197 2020/11/08 23:54:28 rillig Exp $        */
+/*     $NetBSD: cond.c,v 1.198 2020/11/09 00:07:06 rillig Exp $        */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -93,7 +93,7 @@
 #include "dir.h"
 
 /*     "@(#)cond.c     8.2 (Berkeley) 1/2/94"  */
-MAKE_RCSID("$NetBSD: cond.c,v 1.197 2020/11/08 23:54:28 rillig Exp $");
+MAKE_RCSID("$NetBSD: cond.c,v 1.198 2020/11/09 00:07:06 rillig Exp $");
 
 /*
  * The parsing of conditional expressions is based on this grammar:
@@ -860,8 +860,9 @@
        par->p++;
        return TOK_NOT;
 
-    case '#':
-    case '\n':
+    case '#':                  /* XXX: see unit-tests/cond-token-plain.mk */
+    case '\n':                 /* XXX: why should this end the condition? */
+                               /* Probably obsolete now, from 1993-03-21. */
     case '\0':
        return TOK_EOF;
 
diff -r 8840b1804606 -r d79207747384 usr.bin/make/unit-tests/cond-token-plain.mk
--- a/usr.bin/make/unit-tests/cond-token-plain.mk       Sun Nov 08 23:54:28 2020 +0000
+++ b/usr.bin/make/unit-tests/cond-token-plain.mk       Mon Nov 09 00:07:06 2020 +0000
@@ -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.5 2020/11/09 00:07:06 rillig Exp $
 #
 # Tests for plain tokens (that is, string literals without quotes)
 # in .if conditions.
@@ -31,6 +31,9 @@
 # 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



Home | Main Index | Thread Index | Old Index