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: add quotes around variable name in an err...



details:   https://anonhg.NetBSD.org/src/rev/fe9c46635d37
branches:  trunk
changeset: 952988:fe9c46635d37
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Feb 23 00:04:48 2021 +0000

description:
make: add quotes around variable name in an error message

diffstat:

 usr.bin/make/unit-tests/moderrs.exp       |  38 +++++++++++++++---------------
 usr.bin/make/unit-tests/varmod-assign.exp |   2 +-
 usr.bin/make/unit-tests/varmod-edge.exp   |   6 ++--
 usr.bin/make/unit-tests/varmod-edge.mk    |   8 ++++-
 usr.bin/make/unit-tests/varmod-sysv.exp   |   2 +-
 usr.bin/make/var.c                        |   6 ++--
 6 files changed, 33 insertions(+), 29 deletions(-)

diffs (193 lines):

diff -r 41fae7cf3c14 -r fe9c46635d37 usr.bin/make/unit-tests/moderrs.exp
--- a/usr.bin/make/unit-tests/moderrs.exp       Mon Feb 22 23:59:43 2021 +0000
+++ b/usr.bin/make/unit-tests/moderrs.exp       Tue Feb 23 00:04:48 2021 +0000
@@ -20,15 +20,15 @@
 
 unfinished-indirect:
 want: Unfinished modifier for VAR (',' missing)
-make: Unfinished modifier for VAR (',' missing)
+make: Unfinished modifier for "VAR" (',' missing)
 VAR:S,V,v=
 
 unfinished-loop:
 want: Unfinished modifier for UNDEF ('@' missing)
-make: Unfinished modifier for UNDEF ('@' missing)
+make: Unfinished modifier for "UNDEF" ('@' missing)
 
 want: Unfinished modifier for UNDEF ('@' missing)
-make: Unfinished modifier for UNDEF ('@' missing)
+make: Unfinished modifier for "UNDEF" ('@' missing)
 
 1 2 3
 
@@ -39,10 +39,10 @@
 
 words:
 want: Unfinished modifier for UNDEF (']' missing)
-make: Unfinished modifier for UNDEF (']' missing)
+make: Unfinished modifier for "UNDEF" (']' missing)
 
 want: Unfinished modifier for UNDEF (']' missing)
-make: Unfinished modifier for UNDEF (']' missing)
+make: Unfinished modifier for "UNDEF" (']' missing)
 
 13=
 make: Bad modifier `:[123451234512345123451234512345]' for UNDEF
@@ -50,22 +50,22 @@
 
 exclam:
 want: Unfinished modifier for VARNAME ('!' missing)
-make: Unfinished modifier for VARNAME ('!' missing)
+make: Unfinished modifier for "VARNAME" ('!' missing)
 
 want: Unfinished modifier for ! ('!' missing)
-make: Unfinished modifier for ! ('!' missing)
+make: Unfinished modifier for "!" ('!' missing)
 
 
 mod-subst-delimiter:
 make: Missing delimiter for :S modifier
 1:
-make: Unfinished modifier for VAR (',' missing)
+make: Unfinished modifier for "VAR" (',' missing)
 2:
-make: Unfinished modifier for VAR (',' missing)
+make: Unfinished modifier for "VAR" (',' missing)
 3:
-make: Unfinished modifier for VAR (',' missing)
+make: Unfinished modifier for "VAR" (',' missing)
 4:
-make: Unfinished modifier for VAR (',' missing)
+make: Unfinished modifier for "VAR" (',' missing)
 5:
 make: Unclosed variable specification (expecting '}') for "VAR" (value "TheVariable") modifier S
 6: TheVariable
@@ -74,13 +74,13 @@
 mod-regex-delimiter:
 make: Missing delimiter for :C modifier
 1:
-make: Unfinished modifier for VAR (',' missing)
+make: Unfinished modifier for "VAR" (',' missing)
 2:
-make: Unfinished modifier for VAR (',' missing)
+make: Unfinished modifier for "VAR" (',' missing)
 3:
-make: Unfinished modifier for VAR (',' missing)
+make: Unfinished modifier for "VAR" (',' missing)
 4:
-make: Unfinished modifier for VAR (',' missing)
+make: Unfinished modifier for "VAR" (',' missing)
 5:
 make: Unclosed variable specification (expecting '}') for "VAR" (value "TheVariable") modifier C
 6: TheVariable
@@ -114,13 +114,13 @@
 M*}
 
 mod-ifelse-parse:
-make: Unfinished modifier for FIB (':' missing)
+make: Unfinished modifier for "FIB" (':' missing)
 
-make: Unfinished modifier for FIB (':' missing)
+make: Unfinished modifier for "FIB" (':' missing)
 
-make: Unfinished modifier for FIB ('}' missing)
+make: Unfinished modifier for "FIB" ('}' missing)
 
-make: Unfinished modifier for FIB ('}' missing)
+make: Unfinished modifier for "FIB" ('}' missing)
 
 then
 
diff -r 41fae7cf3c14 -r fe9c46635d37 usr.bin/make/unit-tests/varmod-assign.exp
--- a/usr.bin/make/unit-tests/varmod-assign.exp Mon Feb 22 23:59:43 2021 +0000
+++ b/usr.bin/make/unit-tests/varmod-assign.exp Tue Feb 23 00:04:48 2021 +0000
@@ -18,7 +18,7 @@
 make: Unknown modifier ':'
 
 sysv:y
-make: Unfinished modifier for ASSIGN ('}' missing)
+make: Unfinished modifier for "ASSIGN" ('}' missing)
 
 ok=word
 make: " echo word; false " returned non-zero status
diff -r 41fae7cf3c14 -r fe9c46635d37 usr.bin/make/unit-tests/varmod-edge.exp
--- a/usr.bin/make/unit-tests/varmod-edge.exp   Mon Feb 22 23:59:43 2021 +0000
+++ b/usr.bin/make/unit-tests/varmod-edge.exp   Tue Feb 23 00:04:48 2021 +0000
@@ -12,7 +12,7 @@
 make: "varmod-edge.mk" line 166: ok eq-ext
 make: "varmod-edge.mk" line 166: ok eq-q
 make: "varmod-edge.mk" line 166: ok eq-bs
-make: Unfinished modifier for INP.eq-esc ('=' missing)
+make: Unfinished modifier for "INP.eq-esc" ('=' missing)
 make: "varmod-edge.mk" line 166: ok eq-esc
 make: "varmod-edge.mk" line 166: ok colon
 make: "varmod-edge.mk" line 165: Unknown modifier ':'
@@ -20,8 +20,8 @@
 make: "varmod-edge.mk" line 166: ok colons
 make: "varmod-edge.mk" line 175: Unknown modifier 'Z'
 make: "varmod-edge.mk" line 175: Malformed conditional (${:Z})
-make: Unfinished modifier for  (',' missing)
-make: "varmod-edge.mk" line 184: Malformed conditional (${:S,})
+make: Unfinished modifier for "" (',' missing)
+make: "varmod-edge.mk" line 188: Malformed conditional (${:S,})
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
 exit status 1
diff -r 41fae7cf3c14 -r fe9c46635d37 usr.bin/make/unit-tests/varmod-edge.mk
--- a/usr.bin/make/unit-tests/varmod-edge.mk    Mon Feb 22 23:59:43 2021 +0000
+++ b/usr.bin/make/unit-tests/varmod-edge.mk    Tue Feb 23 00:04:48 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: varmod-edge.mk,v 1.14 2021/02/22 23:59:43 rillig Exp $
+# $NetBSD: varmod-edge.mk,v 1.15 2021/02/23 00:04:48 rillig Exp $
 #
 # Tests for edge cases in variable modifiers.
 #
@@ -179,7 +179,11 @@
 .endif
 
 # Even in expressions based on an unnamed variable, there may be errors.
-# XXX: The error message should not contain two spaces in a row.
+#
+# Before var.c 1.842 from 2021-02-23, the error message did not surround the
+# variable name with quotes, leading to the rather confusing "Unfinished
+# modifier for  (',' missing)", having two spaces in a row.
+#
 # XXX: The error message should report the filename:lineno.
 .if ${:S,}
 .  error
diff -r 41fae7cf3c14 -r fe9c46635d37 usr.bin/make/unit-tests/varmod-sysv.exp
--- a/usr.bin/make/unit-tests/varmod-sysv.exp   Mon Feb 22 23:59:43 2021 +0000
+++ b/usr.bin/make/unit-tests/varmod-sysv.exp   Tue Feb 23 00:04:48 2021 +0000
@@ -1,4 +1,4 @@
-make: Unfinished modifier for word214 ('=' missing)
+make: Unfinished modifier for "word214" ('=' missing)
 make: "varmod-sysv.mk" line 214: Malformed conditional (${word214:L:from${:D=}to})
 make: Fatal errors encountered -- cannot continue
 make: stopped in unit-tests
diff -r 41fae7cf3c14 -r fe9c46635d37 usr.bin/make/var.c
--- a/usr.bin/make/var.c        Mon Feb 22 23:59:43 2021 +0000
+++ b/usr.bin/make/var.c        Tue Feb 23 00:04:48 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: var.c,v 1.841 2021/02/22 23:46:03 rillig Exp $ */
+/*     $NetBSD: var.c,v 1.842 2021/02/23 00:04:48 rillig Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -140,7 +140,7 @@
 #include "metachar.h"
 
 /*     "@(#)var.c      8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: var.c,v 1.841 2021/02/22 23:46:03 rillig Exp $");
+MAKE_RCSID("$NetBSD: var.c,v 1.842 2021/02/23 00:04:48 rillig Exp $");
 
 typedef enum VarFlags {
        VFL_NONE        = 0,
@@ -2234,7 +2234,7 @@
 
        if (*p != delim) {
                *pp = p;
-               Error("Unfinished modifier for %s ('%c' missing)",
+               Error("Unfinished modifier for \"%s\" ('%c' missing)",
                    st->expr->var->name.str, delim);
                *out_part = NULL;
                return VPR_ERR;



Home | Main Index | Thread Index | Old Index