Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make Replace __dead, __unused and the various printf...



details:   https://anonhg.NetBSD.org/src/rev/7ecfb39015eb
branches:  trunk
changeset: 779705:7ecfb39015eb
user:      joerg <joerg%NetBSD.org@localhost>
date:      Tue Jun 12 19:21:50 2012 +0000

description:
Replace __dead, __unused and the various printf format attributes
with versions prefixed by MAKE_ATTR_* to avoid modifying the
implementation namespace. Make sure they are available in all places
using nonints.h to fix bootstrap on Linux.

diffstat:

 usr.bin/make/arch.c        |   8 ++++----
 usr.bin/make/cond.c        |  20 ++++++++++----------
 usr.bin/make/dir.c         |  12 ++++++------
 usr.bin/make/job.c         |  16 ++++++++--------
 usr.bin/make/main.c        |  12 ++++++------
 usr.bin/make/make.c        |  12 ++++++------
 usr.bin/make/make.h        |  31 +++++++++++++++++++------------
 usr.bin/make/make_malloc.c |   7 ++++---
 usr.bin/make/nonints.h     |  22 +++++++---------------
 usr.bin/make/parse.c       |  10 +++++-----
 usr.bin/make/targ.c        |  12 ++++++------
 usr.bin/make/var.c         |  34 ++++++++++++++++++----------------
 12 files changed, 99 insertions(+), 97 deletions(-)

diffs (truncated from 711 to 300 lines):

diff -r 2b0d1e455252 -r 7ecfb39015eb usr.bin/make/arch.c
--- a/usr.bin/make/arch.c       Tue Jun 12 19:03:26 2012 +0000
+++ b/usr.bin/make/arch.c       Tue Jun 12 19:21:50 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arch.c,v 1.62 2010/11/27 16:00:09 christos Exp $       */
+/*     $NetBSD: arch.c,v 1.63 2012/06/12 19:21:50 joerg Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: arch.c,v 1.62 2010/11/27 16:00:09 christos Exp $";
+static char rcsid[] = "$NetBSD: arch.c,v 1.63 2012/06/12 19:21:50 joerg Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)arch.c     8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: arch.c,v 1.62 2010/11/27 16:00:09 christos Exp $");
+__RCSID("$NetBSD: arch.c,v 1.63 2012/06/12 19:21:50 joerg Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1029,7 +1029,7 @@
  */
 void
 #if !defined(RANLIBMAG)
-Arch_TouchLib(GNode *gn __unused)
+Arch_TouchLib(GNode *gn MAKE_ATTR_UNUSED)
 #else
 Arch_TouchLib(GNode *gn)
 #endif
diff -r 2b0d1e455252 -r 7ecfb39015eb usr.bin/make/cond.c
--- a/usr.bin/make/cond.c       Tue Jun 12 19:03:26 2012 +0000
+++ b/usr.bin/make/cond.c       Tue Jun 12 19:21:50 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cond.c,v 1.63 2012/05/21 06:30:02 sjg Exp $    */
+/*     $NetBSD: cond.c,v 1.64 2012/06/12 19:21:50 joerg Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: cond.c,v 1.63 2012/05/21 06:30:02 sjg Exp $";
+static char rcsid[] = "$NetBSD: cond.c,v 1.64 2012/06/12 19:21:50 joerg Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)cond.c     8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: cond.c,v 1.63 2012/05/21 06:30:02 sjg Exp $");
+__RCSID("$NetBSD: cond.c,v 1.64 2012/06/12 19:21:50 joerg Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -327,7 +327,7 @@
  *-----------------------------------------------------------------------
  */
 static Boolean
-CondDoDefined(int argLen __unused, const char *arg)
+CondDoDefined(int argLen MAKE_ATTR_UNUSED, const char *arg)
 {
     char    *p1;
     Boolean result;
@@ -376,7 +376,7 @@
  *-----------------------------------------------------------------------
  */
 static Boolean
-CondDoMake(int argLen __unused, const char *arg)
+CondDoMake(int argLen MAKE_ATTR_UNUSED, const char *arg)
 {
     return Lst_Find(create, arg, CondStrMatch) != NULL;
 }
@@ -395,7 +395,7 @@
  *-----------------------------------------------------------------------
  */
 static Boolean
-CondDoExists(int argLen __unused, const char *arg)
+CondDoExists(int argLen MAKE_ATTR_UNUSED, const char *arg)
 {
     Boolean result;
     char    *path;
@@ -428,7 +428,7 @@
  *-----------------------------------------------------------------------
  */
 static Boolean
-CondDoTarget(int argLen __unused, const char *arg)
+CondDoTarget(int argLen MAKE_ATTR_UNUSED, const char *arg)
 {
     GNode   *gn;
 
@@ -452,7 +452,7 @@
  *-----------------------------------------------------------------------
  */
 static Boolean
-CondDoCommands(int argLen __unused, const char *arg)
+CondDoCommands(int argLen MAKE_ATTR_UNUSED, const char *arg)
 {
     GNode   *gn;
 
@@ -790,7 +790,7 @@
 }
 
 static int
-get_mpt_arg(char **linePtr, char **argPtr, const char *func __unused)
+get_mpt_arg(char **linePtr, char **argPtr, const char *func MAKE_ATTR_UNUSED)
 {
     /*
      * Use Var_Parse to parse the spec in parens and return
@@ -831,7 +831,7 @@
 }
 
 static Boolean
-CondDoEmpty(int arglen, const char *arg __unused)
+CondDoEmpty(int arglen, const char *arg MAKE_ATTR_UNUSED)
 {
     return arglen == 1;
 }
diff -r 2b0d1e455252 -r 7ecfb39015eb usr.bin/make/dir.c
--- a/usr.bin/make/dir.c        Tue Jun 12 19:03:26 2012 +0000
+++ b/usr.bin/make/dir.c        Tue Jun 12 19:21:50 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dir.c,v 1.64 2012/04/07 18:29:08 christos Exp $        */
+/*     $NetBSD: dir.c,v 1.65 2012/06/12 19:21:50 joerg Exp $   */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: dir.c,v 1.64 2012/04/07 18:29:08 christos Exp $";
+static char rcsid[] = "$NetBSD: dir.c,v 1.65 2012/06/12 19:21:50 joerg Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)dir.c      8.2 (Berkeley) 1/2/94";
 #else
-__RCSID("$NetBSD: dir.c,v 1.64 2012/04/07 18:29:08 christos Exp $");
+__RCSID("$NetBSD: dir.c,v 1.65 2012/06/12 19:21:50 joerg Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -860,8 +860,8 @@
  *-----------------------------------------------------------------------
  */
 static char *
-DirLookup(Path *p, const char *name __unused, const char *cp, 
-          Boolean hasSlash __unused)
+DirLookup(Path *p, const char *name MAKE_ATTR_UNUSED, const char *cp, 
+          Boolean hasSlash MAKE_ATTR_UNUSED)
 {
     char *file;                /* the current filename to check */
 
@@ -1004,7 +1004,7 @@
  *-----------------------------------------------------------------------
  */
 static char *
-DirFindDot(Boolean hasSlash __unused, const char *name, const char *cp)
+DirFindDot(Boolean hasSlash MAKE_ATTR_UNUSED, const char *name, const char *cp)
 {
 
        if (Hash_FindEntry(&dot->files, cp) != NULL) {
diff -r 2b0d1e455252 -r 7ecfb39015eb usr.bin/make/job.c
--- a/usr.bin/make/job.c        Tue Jun 12 19:03:26 2012 +0000
+++ b/usr.bin/make/job.c        Tue Jun 12 19:21:50 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.c,v 1.161 2012/04/07 18:29:08 christos Exp $       */
+/*     $NetBSD: job.c,v 1.162 2012/06/12 19:21:50 joerg 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.161 2012/04/07 18:29:08 christos Exp $";
+static char rcsid[] = "$NetBSD: job.c,v 1.162 2012/06/12 19:21:50 joerg 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.161 2012/04/07 18:29:08 christos Exp $");
+__RCSID("$NetBSD: job.c,v 1.162 2012/06/12 19:21:50 joerg Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -352,7 +352,7 @@
 static char *JobOutput(Job *, char *, char *, int);
 static void JobDoOutput(Job *, Boolean);
 static Shell *JobMatchShell(const char *);
-static void JobInterrupt(int, int) __dead;
+static void JobInterrupt(int, int) MAKE_ATTR_DEAD;
 static void JobRestartJobs(void);
 static void JobTokenAdd(void);
 static void JobSigLock(sigset_t *);
@@ -475,7 +475,7 @@
  *-----------------------------------------------------------------------
  */
 static void
-JobChildSig(int signo __unused)
+JobChildSig(int signo MAKE_ATTR_UNUSED)
 {
     write(childExitJob.outPipe, CHILD_EXIT, 1);
 }
@@ -498,7 +498,7 @@
  *-----------------------------------------------------------------------
  */
 static void
-JobContinueSig(int signo __unused)
+JobContinueSig(int signo MAKE_ATTR_UNUSED)
 {
     /*
      * Defer sending to SIGCONT to our stopped children until we return
@@ -523,14 +523,14 @@
  *
  *-----------------------------------------------------------------------
  */
-__dead static void
+MAKE_ATTR_DEAD static void
 JobPassSig_int(int signo)
 {
     /* Run .INTERRUPT target then exit */
     JobInterrupt(TRUE, signo);
 }
 
-__dead static void
+MAKE_ATTR_DEAD static void
 JobPassSig_term(int signo)
 {
     /* Dont run .INTERRUPT target then exit */
diff -r 2b0d1e455252 -r 7ecfb39015eb usr.bin/make/main.c
--- a/usr.bin/make/main.c       Tue Jun 12 19:03:26 2012 +0000
+++ b/usr.bin/make/main.c       Tue Jun 12 19:21:50 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.199 2012/04/24 20:35:04 sjg Exp $   */
+/*     $NetBSD: main.c,v 1.200 2012/06/12 19:21:51 joerg Exp $ */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.199 2012/04/24 20:35:04 sjg Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.200 2012/06/12 19:21:51 joerg Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
@@ -81,7 +81,7 @@
 #if 0
 static char sccsid[] = "@(#)main.c     8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.199 2012/04/24 20:35:04 sjg Exp $");
+__RCSID("$NetBSD: main.c,v 1.200 2012/06/12 19:21:51 joerg Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -178,7 +178,7 @@
 static char *          Check_Cwd_av(int, char **, int);
 static void            MainParseArgs(int, char **);
 static int             ReadMakefile(const void *, const void *);
-static void            usage(void) __dead;
+static void            usage(void) MAKE_ATTR_DEAD;
 
 static Boolean         ignorePWD;      /* if we use -C, PWD is meaningless */
 static char objdir[MAXPATHLEN + 1];    /* where we chdir'ed to */
@@ -707,7 +707,7 @@
 #ifdef SIGINFO
 /*ARGSUSED*/
 static void
-siginfo(int signo __unused)
+siginfo(int signo MAKE_ATTR_UNUSED)
 {
        char dir[MAXPATHLEN];
        char str[2 * MAXPATHLEN];
@@ -1301,7 +1301,7 @@
  *     lots
  */
 static int
-ReadMakefile(const void *p, const void *q __unused)
+ReadMakefile(const void *p, const void *q MAKE_ATTR_UNUSED)
 {
        const char *fname = p;          /* makefile to read */
        int fd;
diff -r 2b0d1e455252 -r 7ecfb39015eb usr.bin/make/make.c
--- a/usr.bin/make/make.c       Tue Jun 12 19:03:26 2012 +0000
+++ b/usr.bin/make/make.c       Tue Jun 12 19:21:50 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: make.c,v 1.86 2012/05/10 19:53:26 christos Exp $       */
+/*     $NetBSD: make.c,v 1.87 2012/06/12 19:21:51 joerg Exp $  */



Home | Main Index | Thread Index | Old Index