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): remove wrong error message for indirec...
details: https://anonhg.NetBSD.org/src/rev/ae9055537cc4
branches: trunk
changeset: 948208:ae9055537cc4
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Dec 20 19:10:53 2020 +0000
description:
make(1): remove wrong error message for indirect modifier in lint mode
diffstat:
usr.bin/make/unit-tests/opt-debug-lint.exp | 1 -
usr.bin/make/unit-tests/opt-debug-lint.mk | 15 ++++++++++++---
usr.bin/make/var.c | 10 ++--------
3 files changed, 14 insertions(+), 12 deletions(-)
diffs (74 lines):
diff -r 8cbb94575a6b -r ae9055537cc4 usr.bin/make/unit-tests/opt-debug-lint.exp
--- a/usr.bin/make/unit-tests/opt-debug-lint.exp Sun Dec 20 19:02:28 2020 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-lint.exp Sun Dec 20 19:10:53 2020 +0000
@@ -2,7 +2,6 @@
make: "opt-debug-lint.mk" line 41: Variable "UNDEF" is undefined
make: "opt-debug-lint.mk" line 61: Missing delimiter ':' after modifier "L"
make: "opt-debug-lint.mk" line 61: Missing delimiter ':' after modifier "P"
-make: "opt-debug-lint.mk" line 67: Missing delimiter ':' after indirect modifier "${:UL}"
make: Unknown modifier '$'
make: Fatal errors encountered -- cannot continue
make: stopped in unit-tests
diff -r 8cbb94575a6b -r ae9055537cc4 usr.bin/make/unit-tests/opt-debug-lint.mk
--- a/usr.bin/make/unit-tests/opt-debug-lint.mk Sun Dec 20 19:02:28 2020 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-lint.mk Sun Dec 20 19:10:53 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: opt-debug-lint.mk,v 1.11 2020/10/24 08:50:17 rillig Exp $
+# $NetBSD: opt-debug-lint.mk,v 1.12 2020/12/20 19:10:53 rillig Exp $
#
# Tests for the -dL command line option, which runs additional checks
# to catch common mistakes, such as unclosed variable expressions.
@@ -62,11 +62,20 @@
. error
.endif
-# Since 2020-10-03, in lint mode the variable modifier must be separated
-# by colons. See varparse-mod.mk.
+# Between 2020-10-03 and var.c 1.752 from 2020-12-20, in lint mode the
+# variable modifier had to be separated by colons. This was wrong though
+# since make always fell back trying to parse the indirect modifier as a
+# SysV modifier.
.if ${value:${:UL}PL} != "LPL}" # FIXME: "LPL}" is unexpected here.
. error ${value:${:UL}PL}
.endif
+# Typically, an indirect modifier is followed by a colon or the closing
+# brace. This one isn't, therefore make falls back to parsing it as the SysV
+# modifier ":lue=lid".
+.if ${value:L:${:Ulue}=${:Ulid}} != "valid"
+. error
+.endif
+
all:
@:;
diff -r 8cbb94575a6b -r ae9055537cc4 usr.bin/make/var.c
--- a/usr.bin/make/var.c Sun Dec 20 19:02:28 2020 +0000
+++ b/usr.bin/make/var.c Sun Dec 20 19:10:53 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: var.c,v 1.752 2020/12/20 19:02:28 rillig Exp $ */
+/* $NetBSD: var.c,v 1.753 2020/12/20 19:10:53 rillig Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
#include "metachar.h"
/* "@(#)var.c 8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.752 2020/12/20 19:02:28 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.753 2020/12/20 19:10:53 rillig Exp $");
typedef enum VarFlags {
VAR_NONE = 0,
@@ -3455,12 +3455,6 @@
/* TODO: handle errors */
if (mods.str[0] != '\0' && *p != '\0' && *p != ':' && *p != st->endc) {
- if (opts.lint)
- Parse_Error(PARSE_FATAL,
- "Missing delimiter ':' "
- "after indirect modifier \"%.*s\"",
- (int)(p - *pp), *pp);
-
FStr_Done(&mods);
return AMIR_APPLY_MODS;
}
Home |
Main Index |
Thread Index |
Old Index