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 constness of shellArgv



details:   https://anonhg.NetBSD.org/src/rev/749b8192b620
branches:  trunk
changeset: 942914:749b8192b620
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Aug 22 09:51:57 2020 +0000

description:
make(1): fix constness of shellArgv

This is needed to build with -DCLEANUP, which apparently nobody did for
the last 17 years, or at least since -Werror was introduced.

diffstat:

 usr.bin/make/job.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (44 lines):

diff -r 174f57e9b3c3 -r 749b8192b620 usr.bin/make/job.c
--- a/usr.bin/make/job.c        Sat Aug 22 09:40:18 2020 +0000
+++ b/usr.bin/make/job.c        Sat Aug 22 09:51:57 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.c,v 1.208 2020/08/22 08:01:34 rillig Exp $ */
+/*     $NetBSD: job.c,v 1.209 2020/08/22 09:51:57 rillig 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.208 2020/08/22 08:01:34 rillig Exp $";
+static char rcsid[] = "$NetBSD: job.c,v 1.209 2020/08/22 09:51:57 rillig 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.208 2020/08/22 08:01:34 rillig Exp $");
+__RCSID("$NetBSD: job.c,v 1.209 2020/08/22 09:51:57 rillig Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -300,7 +300,7 @@
                                                   * executable image */
           *shellName = NULL;                     /* last component of shell */
 char *shellErrFlag = NULL;
-static const char *shellArgv = NULL;             /* Custom shell args */
+static char *shellArgv = NULL; /* Custom shell args */
 
 
 STATIC Job     *job_table;     /* The structures that describe them */
@@ -2458,7 +2458,7 @@
        line++;
     }
 
-    free(UNCONST(shellArgv));
+    free(shellArgv);
 
     memset(&newShell, 0, sizeof(newShell));
 



Home | Main Index | Thread Index | Old Index