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 dead and broken warning for nov...



details:   https://anonhg.NetBSD.org/src/rev/02255d1d56ef
branches:  trunk
changeset: 977175:02255d1d56ef
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Oct 17 20:32:20 2020 +0000

description:
make(1): remove dead and broken warning for novices

In non-POSIX mode (which can only be enabled by editing config.h),
having a shell command indented by spaces instead of tabs would generate
a warning, and then, contrary to the comment above the code, no command
would be added to the current targets, since *cp == '\0'.

This had been broken since parse.c 1.133 on 2007-02-24, therefore it
seems unnecessary to even try to fix this code.

diffstat:

 usr.bin/make/parse.c |  28 ++--------------------------
 1 files changed, 2 insertions(+), 26 deletions(-)

diffs (49 lines):

diff -r 13dde9f2daf2 -r 02255d1d56ef usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Sat Oct 17 20:10:04 2020 +0000
+++ b/usr.bin/make/parse.c      Sat Oct 17 20:32:20 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.377 2020/10/17 19:10:07 rillig Exp $       */
+/*     $NetBSD: parse.c,v 1.378 2020/10/17 20:32:20 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.377 2020/10/17 19:10:07 rillig Exp $");
+MAKE_RCSID("$NetBSD: parse.c,v 1.378 2020/10/17 20:32:20 rillig Exp $");
 
 /* types and constants */
 
@@ -2991,30 +2991,6 @@
                }
            }
 
-#ifndef POSIX
-           /*
-            * To make life easier on novices, if the line is indented we
-            * first make sure the line has a dependency operator in it.
-            * If it doesn't have an operator and we're in a dependency
-            * line's script, we assume it's actually a shell command
-            * and add it to the current list of targets.
-            */
-           cp = line;
-           if (ch_isspace(line[0])) {
-               pp_skip_whitespace(&cp);
-               while (*cp && (ParseIsEscaped(line, cp) ||
-                       *cp != ':' && *cp != '!')) {
-                   cp++;
-               }
-               if (*cp == '\0') {
-                   if (targets == NULL) {
-                       Parse_Error(PARSE_WARNING,
-                                    "Shell command needs a leading tab");
-                       goto shellCommand;
-                   }
-               }
-           }
-#endif
            FinishDependencyGroup();
 
            /*



Home | Main Index | Thread Index | Old Index