Module Name:    src
Committed By:   rillig
Date:           Thu Nov 19 21:27:29 UTC 2020

Modified Files:
        src/usr.bin/make: suff.c

Log Message:
make(1): mark srclist as a bad global variable

The previous comment "List of sources" didn't tell anything about the
purpose of the variable, it was only useful before July 2020, when its
data type was still Lst, without any type information.

Having a global variable here seems pointless, but all the code about
suffix transformations is so tricky and not well covered by tests that I
don't dare to convert the global variable to a local variable in
Suff_FindDeps.  The change itself would be trivial, but the hidden and
undocumented intentions of the original author probably aren't.


To generate a diff of this commit:
cvs rdiff -u -r1.249 -r1.250 src/usr.bin/make/suff.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/suff.c
diff -u src/usr.bin/make/suff.c:1.249 src/usr.bin/make/suff.c:1.250
--- src/usr.bin/make/suff.c:1.249	Thu Nov 19 14:42:33 2020
+++ src/usr.bin/make/suff.c	Thu Nov 19 21:27:29 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: suff.c,v 1.249 2020/11/19 14:42:33 rillig Exp $	*/
+/*	$NetBSD: suff.c,v 1.250 2020/11/19 21:27:29 rillig Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -114,7 +114,7 @@
 #include "dir.h"
 
 /*	"@(#)suff.c	8.4 (Berkeley) 3/21/94"	*/
-MAKE_RCSID("$NetBSD: suff.c,v 1.249 2020/11/19 14:42:33 rillig Exp $");
+MAKE_RCSID("$NetBSD: suff.c,v 1.250 2020/11/19 21:27:29 rillig Exp $");
 
 #define SUFF_DEBUG0(text) DEBUG0(SUFF, text)
 #define SUFF_DEBUG1(fmt, arg1) DEBUG1(SUFF, fmt, arg1)
@@ -130,7 +130,10 @@ static SuffList *sufflist;	/* List of su
 #ifdef CLEANUP
 static SuffList *suffClean;	/* List of suffixes to be cleaned */
 #endif
-static SrcList *srclist;	/* List of sources */
+
+/* XXX: What exactly is this variable used for? */
+/* XXX: Does it really have to be a global variable? */
+static SrcList *srclist;
 
 /* List of transformation rules, such as ".c.o" */
 static GNodeList *transforms;

Reply via email to