Module Name:    src
Committed By:   christos
Date:           Sun Aug 14 13:06:09 UTC 2011

Modified Files:
        src/usr.bin/make: Makefile compat.c job.c

Log Message:
- remove gcc-4.5 warnings
- simplify job printing code
- document non-literal format strings


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/usr.bin/make/Makefile
cvs rdiff -u -r1.82 -r1.83 src/usr.bin/make/compat.c
cvs rdiff -u -r1.157 -r1.158 src/usr.bin/make/job.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/Makefile
diff -u src/usr.bin/make/Makefile:1.54 src/usr.bin/make/Makefile:1.55
--- src/usr.bin/make/Makefile:1.54	Tue Jun 21 22:49:44 2011
+++ src/usr.bin/make/Makefile	Sun Aug 14 09:06:09 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.54 2011/06/22 02:49:44 mrg Exp $
+#	$NetBSD: Makefile,v 1.55 2011/08/14 13:06:09 christos Exp $
 #	@(#)Makefile	5.2 (Berkeley) 12/28/90
 
 PROG=	make
@@ -36,7 +36,10 @@
 .include <bsd.subdir.mk>
 
 CPPFLAGS+= -DMAKE_NATIVE
-COPTS.var.c+= -Wno-cast-qual
+COPTS.var.c += -Wno-cast-qual
+COPTS.job.c += -Wno-format-nonliteral
+COPTS.parse.c += -Wno-format-nonliteral
+COPTS.var.c += -Wno-format-nonliteral
 
 .ifdef TOOLDIR
 # this is a native netbsd build, 
@@ -49,8 +52,3 @@
 # A simple unit-test driver to help catch regressions
 accept test:
 	cd ${.CURDIR}/unit-tests && ${.MAKE} -r -m / TEST_MAKE=${TEST_MAKE:U${.OBJDIR}/${PROG:T}} ${.TARGET}
-
-# XXX
-.if ${HAVE_GCC} == 45
-COPTS.compat.c+=	-Wno-error
-.endif

Index: src/usr.bin/make/compat.c
diff -u src/usr.bin/make/compat.c:1.82 src/usr.bin/make/compat.c:1.83
--- src/usr.bin/make/compat.c:1.82	Thu Nov 25 16:31:09 2010
+++ src/usr.bin/make/compat.c	Sun Aug 14 09:06:09 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat.c,v 1.82 2010/11/25 21:31:09 christos Exp $	*/
+/*	$NetBSD: compat.c,v 1.83 2011/08/14 13:06:09 christos Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: compat.c,v 1.82 2010/11/25 21:31:09 christos Exp $";
+static char rcsid[] = "$NetBSD: compat.c,v 1.83 2011/08/14 13:06:09 christos Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)compat.c	8.2 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: compat.c,v 1.82 2010/11/25 21:31:09 christos Exp $");
+__RCSID("$NetBSD: compat.c,v 1.83 2011/08/14 13:06:09 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -347,7 +347,7 @@
 		useShell = 1;
 		goto again;
 	}
-	av = (const char **)mav;
+	av = (void *)mav;
     }
 
     local = TRUE;

Index: src/usr.bin/make/job.c
diff -u src/usr.bin/make/job.c:1.157 src/usr.bin/make/job.c:1.158
--- src/usr.bin/make/job.c:1.157	Sun Jul 31 22:13:21 2011
+++ src/usr.bin/make/job.c	Sun Aug 14 09:06:09 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: job.c,v 1.157 2011/08/01 02:13:21 christos Exp $	*/
+/*	$NetBSD: job.c,v 1.158 2011/08/14 13:06:09 christos Exp $	*/
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: job.c,v 1.157 2011/08/01 02:13:21 christos Exp $";
+static char rcsid[] = "$NetBSD: job.c,v 1.158 2011/08/14 13:06:09 christos Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)job.c	8.2 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: job.c,v 1.157 2011/08/01 02:13:21 christos Exp $");
+__RCSID("$NetBSD: job.c,v 1.158 2011/08/14 13:06:09 christos Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -321,10 +321,7 @@
 
 STATIC GNode   	*lastNode;	/* The node for which output was most recently
 				 * produced. */
-STATIC const char *targFmt;   	/* Format string to use to head output from a
-				 * job when it's not the most-recent job heard
-				 * from */
-static char *targPrefix = NULL; /* What we print at the start of targFmt */
+static char *targPrefix = NULL; /* What we print at the start of TARG_FMT */
 static Job tokenWaitJob;	/* token wait pseudo-job */
 
 static Job childExitJob;	/* child exit pseudo-job */
@@ -333,7 +330,8 @@
 
 #define TARG_FMT  "%s %s ---\n" /* Default format */
 #define MESSAGE(fp, gn) \
-	(void)fprintf(fp, targFmt, targPrefix, gn->name)
+	if (maxJobs != 1) \
+	    (void)fprintf(fp, TARG_FMT, targPrefix, gn->name)
 
 static sigset_t caught_signals;	/* Set of signals we handle */
 #if defined(SYSV)
@@ -2178,16 +2176,6 @@
 
     lastNode =	  NULL;
 
-    if (maxJobs == 1) {
-	/*
-	 * If only one job can run at a time, there's no need for a banner,
-	 * is there?
-	 */
-	targFmt = "";
-    } else {
-	targFmt = TARG_FMT;
-    }
-
     /*
      * There is a non-zero chance that we already have children.
      * eg after 'make -f- <<EOF'

Reply via email to