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): fix missing check for duplicate comman...



details:   https://anonhg.NetBSD.org/src/rev/81a40a238a4c
branches:  trunk
changeset: 944292:81a40a238a4c
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Sep 25 23:30:16 2020 +0000

description:
make(1): fix missing check for duplicate commands in Parse_File

diffstat:

 usr.bin/make/parse.c                                 |  6 ++++--
 usr.bin/make/unit-tests/dep-colon-bug-cross-file.exp |  3 ++-
 usr.bin/make/unit-tests/dep-colon-bug-cross-file.mk  |  4 +---
 usr.bin/make/unit-tests/opt-debug-graph1.exp         |  2 +-
 4 files changed, 8 insertions(+), 7 deletions(-)

diffs (64 lines):

diff -r 0156b9654e2f -r 81a40a238a4c usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Fri Sep 25 23:24:49 2020 +0000
+++ b/usr.bin/make/parse.c      Fri Sep 25 23:30:16 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.327 2020/09/25 21:13:44 rillig Exp $       */
+/*     $NetBSD: parse.c,v 1.328 2020/09/25 23:30:16 rillig Exp $       */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -131,7 +131,7 @@
 #include "pathnames.h"
 
 /*     "@(#)parse.c    8.3 (Berkeley) 3/19/94" */
-MAKE_RCSID("$NetBSD: parse.c,v 1.327 2020/09/25 21:13:44 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.328 2020/09/25 23:30:16 rillig Exp $");
 
 /* types and constants */
 
@@ -3129,6 +3129,8 @@
         */
     } while (ParseEOF() == CONTINUE);
 
+    ParseFinishLine();
+
     if (fatals) {
        (void)fflush(stdout);
        (void)fprintf(stderr,
diff -r 0156b9654e2f -r 81a40a238a4c usr.bin/make/unit-tests/dep-colon-bug-cross-file.exp
--- a/usr.bin/make/unit-tests/dep-colon-bug-cross-file.exp      Fri Sep 25 23:24:49 2020 +0000
+++ b/usr.bin/make/unit-tests/dep-colon-bug-cross-file.exp      Fri Sep 25 23:30:16 2020 +0000
@@ -1,3 +1,4 @@
+make: "dep-colon-bug-cross-file.mk" line 31: warning: duplicate script for target "all" ignored
+make: "dep-colon-bug-cross-file.mk" line 40: warning: using previous script for "all" defined here
 : pass 1
-: pass 2
 exit status 0
diff -r 0156b9654e2f -r 81a40a238a4c usr.bin/make/unit-tests/dep-colon-bug-cross-file.mk
--- a/usr.bin/make/unit-tests/dep-colon-bug-cross-file.mk       Fri Sep 25 23:24:49 2020 +0000
+++ b/usr.bin/make/unit-tests/dep-colon-bug-cross-file.mk       Fri Sep 25 23:30:16 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: dep-colon-bug-cross-file.mk,v 1.1 2020/09/25 23:24:49 rillig Exp $
+# $NetBSD: dep-colon-bug-cross-file.mk,v 1.2 2020/09/25 23:30:16 rillig Exp $
 #
 # Until 2020-09-25, the very last dependency group of a top-level makefile
 # was not finished properly.  This made it possible to add further commands
@@ -14,8 +14,6 @@
 # which is still the one from pass 1, which means it is possible to even
 # cross file boundaries.
 #
-# TODO: Finish the file properly in Parse_File.
-#
 # Oops, even worse.  Running this test in a make from 2020-09-25 or earlier
 # on NetBSD 8.0 x86_64 with MALLOC_OPTIONS=JA produces this or a similar
 # output:
diff -r 0156b9654e2f -r 81a40a238a4c usr.bin/make/unit-tests/opt-debug-graph1.exp
--- a/usr.bin/make/unit-tests/opt-debug-graph1.exp      Fri Sep 25 23:24:49 2020 +0000
+++ b/usr.bin/make/unit-tests/opt-debug-graph1.exp      Fri Sep 25 23:30:16 2020 +0000
@@ -1,5 +1,5 @@
 #*** Input graph:
-# all, made UNMADE, type OP_DEPENDS, flags none
+# all, made UNMADE, type OP_DEPENDS|OP_HAS_COMMANDS, flags none
 # made-target, made UNMADE, type OP_DEPENDS, flags none
 # made-target-no-sources, made UNMADE, type OP_DEPENDS, flags none
 # made-source, made UNMADE, type OP_DEPENDS, flags none



Home | Main Index | Thread Index | Old Index