Module Name: src Committed By: rillig Date: Mon Oct 5 22:15:45 UTC 2020
Modified Files: src/usr.bin/make: Makefile make.h parse.c targ.c Log Message: make(1): enable format string truncation warnings for parse.c No node is ever going to have a million or more cohorts. And even if there were, this name is only used for printing informational messages. To generate a diff of this commit: cvs rdiff -u -r1.102 -r1.103 src/usr.bin/make/Makefile cvs rdiff -u -r1.155 -r1.156 src/usr.bin/make/make.h cvs rdiff -u -r1.369 -r1.370 src/usr.bin/make/parse.c cvs rdiff -u -r1.111 -r1.112 src/usr.bin/make/targ.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.102 src/usr.bin/make/Makefile:1.103 --- src/usr.bin/make/Makefile:1.102 Mon Oct 5 19:27:47 2020 +++ src/usr.bin/make/Makefile Mon Oct 5 22:15:45 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.102 2020/10/05 19:27:47 rillig Exp $ +# $NetBSD: Makefile,v 1.103 2020/10/05 22:15:45 rillig Exp $ # @(#)Makefile 5.2 (Berkeley) 12/28/90 PROG= make @@ -77,7 +77,6 @@ COPTS.arch.c+= -Wno-error=format-truncat COPTS.dir.c+= -Wno-error=format-truncation COPTS.main.c+= -Wno-error=format-truncation COPTS.meta.c+= -Wno-error=format-truncation -COPTS.parse.c+= -Wno-error=format-truncation .endif # Whether to compile with GCC 8 from pkgsrc, during development. Index: src/usr.bin/make/make.h diff -u src/usr.bin/make/make.h:1.155 src/usr.bin/make/make.h:1.156 --- src/usr.bin/make/make.h:1.155 Mon Oct 5 19:27:47 2020 +++ src/usr.bin/make/make.h Mon Oct 5 22:15:45 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: make.h,v 1.155 2020/10/05 19:27:47 rillig Exp $ */ +/* $NetBSD: make.h,v 1.156 2020/10/05 22:15:45 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -332,7 +332,7 @@ typedef struct GNode { * in the normal sense. */ GNodeList *order_succ; - /* #n for this cohort */ + /* The "#n" suffix for this cohort, or "" for other nodes */ char cohort_num[8]; /* The number of unmade instances on the cohorts list */ int unmade_cohorts; Index: src/usr.bin/make/parse.c diff -u src/usr.bin/make/parse.c:1.369 src/usr.bin/make/parse.c:1.370 --- src/usr.bin/make/parse.c:1.369 Mon Oct 5 21:37:07 2020 +++ src/usr.bin/make/parse.c Mon Oct 5 22:15:45 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.369 2020/10/05 21:37:07 rillig Exp $ */ +/* $NetBSD: parse.c,v 1.370 2020/10/05 22:15:45 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.369 2020/10/05 21:37:07 rillig Exp $"); +MAKE_RCSID("$NetBSD: parse.c,v 1.370 2020/10/05 22:15:45 rillig Exp $"); /* types and constants */ @@ -854,7 +854,7 @@ TryApplyDependencyOperator(GNode *gn, GN cohort->centurion = gn; gn->unmade_cohorts++; snprintf(cohort->cohort_num, sizeof cohort->cohort_num, "#%d", - gn->unmade_cohorts); + gn->unmade_cohorts % 1000000); } else { /* * We don't want to nuke any previous flags (whatever they were) so we Index: src/usr.bin/make/targ.c diff -u src/usr.bin/make/targ.c:1.111 src/usr.bin/make/targ.c:1.112 --- src/usr.bin/make/targ.c:1.111 Mon Oct 5 19:27:47 2020 +++ src/usr.bin/make/targ.c Mon Oct 5 22:15:45 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: targ.c,v 1.111 2020/10/05 19:27:47 rillig Exp $ */ +/* $NetBSD: targ.c,v 1.112 2020/10/05 22:15:45 rillig Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -121,7 +121,7 @@ #include "dir.h" /* "@(#)targ.c 8.2 (Berkeley) 3/19/94" */ -MAKE_RCSID("$NetBSD: targ.c,v 1.111 2020/10/05 19:27:47 rillig Exp $"); +MAKE_RCSID("$NetBSD: targ.c,v 1.112 2020/10/05 22:15:45 rillig Exp $"); static GNodeList *allTargets; /* the list of all targets found so far */ #ifdef CLEANUP @@ -183,7 +183,7 @@ Targ_NewGN(const char *name) gn->type = name[0] == '-' && name[1] == 'l' ? OP_LIB : 0; gn->unmade = 0; gn->unmade_cohorts = 0; - gn->cohort_num[0] = 0; + gn->cohort_num[0] = '\0'; gn->centurion = NULL; gn->made = UNMADE; gn->flags = 0;