Change to use __unused instead and provide a compat definition in make.h if

not already defined from cdefs.h
This commit is contained in:
jmc 2004-07-01 20:38:09 +00:00
parent 07be12b505
commit a2bacbeec5
8 changed files with 50 additions and 139 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: arch.c,v 1.41 2004/07/01 04:39:30 jmc Exp $ */
/* $NetBSD: arch.c,v 1.42 2004/07/01 20:38:09 jmc Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
static char rcsid[] = "$NetBSD: arch.c,v 1.41 2004/07/01 04:39:30 jmc Exp $";
static char rcsid[] = "$NetBSD: arch.c,v 1.42 2004/07/01 20:38:09 jmc 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.41 2004/07/01 04:39:30 jmc Exp $");
__RCSID("$NetBSD: arch.c,v 1.42 2004/07/01 20:38:09 jmc Exp $");
#endif
#endif /* not lint */
#endif
@ -1031,8 +1031,8 @@ Arch_Touch(GNode *gn)
*-----------------------------------------------------------------------
*/
void
#if __GNUC__ && !defined(RANLIBMAG)
Arch_TouchLib(GNode *gn __attribute__((unused)))
#if !defined(RANLIBMAG)
Arch_TouchLib(GNode *gn __unused)
#else
Arch_TouchLib(GNode *gn)
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: dir.c,v 1.42 2004/07/01 04:39:30 jmc Exp $ */
/* $NetBSD: dir.c,v 1.43 2004/07/01 20:38:09 jmc 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.42 2004/07/01 04:39:30 jmc Exp $";
static char rcsid[] = "$NetBSD: dir.c,v 1.43 2004/07/01 20:38:09 jmc 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.42 2004/07/01 04:39:30 jmc Exp $");
__RCSID("$NetBSD: dir.c,v 1.43 2004/07/01 20:38:09 jmc Exp $");
#endif
#endif /* not lint */
#endif
@ -860,12 +860,8 @@ Dir_Expand(const char *word, Lst path, Lst expansions)
*-----------------------------------------------------------------------
*/
static char *
#if __GNUC__
DirLookup(Path *p, const char *name __attribute__((unused)), const char *cp,
Boolean hasSlash __attribute__((unused)))
#else
DirLookup(Path *p, const char *name, const char *cp, Boolean hasSlash)
#endif
DirLookup(Path *p, const char *name __unused, const char *cp,
Boolean hasSlash __unused)
{
char *file; /* the current filename to check */
@ -1007,12 +1003,7 @@ DirLookupAbs(Path *p, const char *name, const char *cp)
*-----------------------------------------------------------------------
*/
static char *
#if __GNUC__
DirFindDot(Boolean hasSlash __attribute__((unused)), const char *name,
const char *cp)
#else
DirFindDot(Boolean hasSlash, const char *name, const char *cp)
#endif
DirFindDot(Boolean hasSlash __unused, const char *name, const char *cp)
{
if (Hash_FindEntry (&dot->files, cp) != (Hash_Entry *)NULL) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: job.c,v 1.86 2004/07/01 04:39:30 jmc Exp $ */
/* $NetBSD: job.c,v 1.87 2004/07/01 20:38:09 jmc 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.86 2004/07/01 04:39:30 jmc Exp $";
static char rcsid[] = "$NetBSD: job.c,v 1.87 2004/07/01 20:38:09 jmc 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.86 2004/07/01 04:39:30 jmc Exp $");
__RCSID("$NetBSD: job.c,v 1.87 2004/07/01 20:38:09 jmc Exp $");
#endif
#endif /* not lint */
#endif
@ -462,11 +462,7 @@ JobCondPassSig(ClientData jobp, ClientData signop)
*-----------------------------------------------------------------------
*/
static void
#if __GNUC__
JobChildSig(int signo __attribute__((unused)))
#else
JobChildSig(int signo)
#endif
JobChildSig(int signo __unused)
{
write(exit_pipe[1], ".", 1);
}
@ -490,11 +486,7 @@ JobChildSig(int signo)
*-----------------------------------------------------------------------
*/
static void
#if __GNUC__
JobContinueSig(int signo __attribute__((unused)))
#else
JobContinueSig(int signo)
#endif
JobContinueSig(int signo __unused)
{
JobRestartJobs();
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: main.c,v 1.103 2004/07/01 04:39:30 jmc Exp $ */
/* $NetBSD: main.c,v 1.104 2004/07/01 20:38:09 jmc Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@ -69,7 +69,7 @@
*/
#ifndef MAKE_NATIVE
static char rcsid[] = "$NetBSD: main.c,v 1.103 2004/07/01 04:39:30 jmc Exp $";
static char rcsid[] = "$NetBSD: main.c,v 1.104 2004/07/01 20:38:09 jmc Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\n\
#if 0
static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
#else
__RCSID("$NetBSD: main.c,v 1.103 2004/07/01 04:39:30 jmc Exp $");
__RCSID("$NetBSD: main.c,v 1.104 2004/07/01 20:38:09 jmc Exp $");
#endif
#endif /* not lint */
#endif
@ -1075,11 +1075,7 @@ main(int argc, char **argv)
* lots
*/
static Boolean
#if __GNUC__
ReadMakefile(ClientData p, ClientData q __attribute__((unused)))
#else
ReadMakefile(ClientData p, ClientData q)
#endif
ReadMakefile(ClientData p, ClientData q __unused)
{
char *fname = p; /* makefile to read */
FILE *stream;

View File

@ -1,4 +1,4 @@
/* $NetBSD: make.c,v 1.54 2004/07/01 04:39:31 jmc Exp $ */
/* $NetBSD: make.c,v 1.55 2004/07/01 20:38:09 jmc Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
static char rcsid[] = "$NetBSD: make.c,v 1.54 2004/07/01 04:39:31 jmc Exp $";
static char rcsid[] = "$NetBSD: make.c,v 1.55 2004/07/01 20:38:09 jmc Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)make.c 8.1 (Berkeley) 6/6/93";
#else
__RCSID("$NetBSD: make.c,v 1.54 2004/07/01 04:39:31 jmc Exp $");
__RCSID("$NetBSD: make.c,v 1.55 2004/07/01 20:38:09 jmc Exp $");
#endif
#endif /* not lint */
#endif
@ -795,11 +795,7 @@ Make_Update(GNode *cgn)
*-----------------------------------------------------------------------
*/
static int
#if __GNUC__
MakeUnmark(ClientData cgnp, ClientData pgnp __attribute__((unused)))
#else
MakeUnmark(ClientData cgnp, ClientData pgnp)
#endif
MakeUnmark(ClientData cgnp, ClientData pgnp __unused)
{
GNode *cgn = (GNode *) cgnp;

View File

@ -1,4 +1,4 @@
/* $NetBSD: make.h,v 1.50 2003/12/07 20:30:28 dsl Exp $ */
/* $NetBSD: make.h,v 1.51 2004/07/01 20:38:09 jmc Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@ -99,6 +99,13 @@
# endif
#endif
#if !defined(__unused)
#if __GNUC_PREREQ__(2, 7)
#define __unused __attribute__((__unused__))
#else
#define __unused /* delete */
#endif
#endif
#include "sprite.h"
#include "lst.h"

View File

@ -1,4 +1,4 @@
/* $NetBSD: targ.c,v 1.32 2004/07/01 04:39:31 jmc Exp $ */
/* $NetBSD: targ.c,v 1.33 2004/07/01 20:38:09 jmc Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
static char rcsid[] = "$NetBSD: targ.c,v 1.32 2004/07/01 04:39:31 jmc Exp $";
static char rcsid[] = "$NetBSD: targ.c,v 1.33 2004/07/01 20:38:09 jmc Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)targ.c 8.2 (Berkeley) 3/19/94";
#else
__RCSID("$NetBSD: targ.c,v 1.32 2004/07/01 04:39:31 jmc Exp $");
__RCSID("$NetBSD: targ.c,v 1.33 2004/07/01 20:38:09 jmc Exp $");
#endif
#endif /* not lint */
#endif
@ -742,11 +742,7 @@ TargPropagateCohort(ClientData cgnp, ClientData pgnp)
}
static int
#if __GNUC__
TargPropagateNode(ClientData gnp, ClientData junk __attribute__((unused)))
#else
TargPropagateNode(ClientData gnp, ClientData junk)
#endif
TargPropagateNode(ClientData gnp, ClientData junk __unused)
{
GNode *gn = (GNode *) gnp;
if (gn->type & OP_DOUBLEDEP)

View File

@ -1,4 +1,4 @@
/* $NetBSD: var.c,v 1.89 2004/07/01 04:39:31 jmc Exp $ */
/* $NetBSD: var.c,v 1.90 2004/07/01 20:38:09 jmc Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
static char rcsid[] = "$NetBSD: var.c,v 1.89 2004/07/01 04:39:31 jmc Exp $";
static char rcsid[] = "$NetBSD: var.c,v 1.90 2004/07/01 20:38:09 jmc Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94";
#else
__RCSID("$NetBSD: var.c,v 1.89 2004/07/01 04:39:31 jmc Exp $");
__RCSID("$NetBSD: var.c,v 1.90 2004/07/01 20:38:09 jmc Exp $");
#endif
#endif /* not lint */
#endif
@ -716,15 +716,9 @@ Var_Value(const char *name, GNode *ctxt, char **frp)
*-----------------------------------------------------------------------
*/
static Boolean
#if __GNUC__
VarHead(GNode *ctx __attribute__((unused)), Var_Parse_State *vpstate,
VarHead(GNode *ctx __unused, Var_Parse_State *vpstate,
char *word, Boolean addSpace, Buffer buf,
ClientData dummy)
#else
VarHead(GNode *ctx, Var_Parse_State *vpstate,
char *word, Boolean addSpace, Buffer buf,
ClientData dummy)
#endif
{
char *slash;
@ -770,15 +764,9 @@ VarHead(GNode *ctx, Var_Parse_State *vpstate,
*-----------------------------------------------------------------------
*/
static Boolean
#if __GNUC__
VarTail(GNode *ctx __attribute__((unused)), Var_Parse_State *vpstate,
VarTail(GNode *ctx __unused, Var_Parse_State *vpstate,
char *word, Boolean addSpace, Buffer buf,
ClientData dummy)
#else
VarTail(GNode *ctx, Var_Parse_State *vpstate,
char *word, Boolean addSpace, Buffer buf,
ClientData dummy)
#endif
{
char *slash;
@ -818,15 +806,9 @@ VarTail(GNode *ctx, Var_Parse_State *vpstate,
*-----------------------------------------------------------------------
*/
static Boolean
#if __GNUC__
VarSuffix(GNode *ctx __attribute__((unused)), Var_Parse_State *vpstate,
VarSuffix(GNode *ctx __unused, Var_Parse_State *vpstate,
char *word, Boolean addSpace, Buffer buf,
ClientData dummy)
#else
VarSuffix(GNode *ctx, Var_Parse_State *vpstate,
char *word, Boolean addSpace, Buffer buf,
ClientData dummy)
#endif
{
char *dot;
@ -865,15 +847,9 @@ VarSuffix(GNode *ctx, Var_Parse_State *vpstate,
*-----------------------------------------------------------------------
*/
static Boolean
#if __GNUC__
VarRoot(GNode *ctx __attribute__((unused)), Var_Parse_State *vpstate,
VarRoot(GNode *ctx __unused, Var_Parse_State *vpstate,
char *word, Boolean addSpace, Buffer buf,
ClientData dummy)
#else
VarRoot(GNode *ctx, Var_Parse_State *vpstate,
char *word, Boolean addSpace, Buffer buf,
ClientData dummy)
#endif
{
char *dot;
@ -915,15 +891,9 @@ VarRoot(GNode *ctx, Var_Parse_State *vpstate,
*-----------------------------------------------------------------------
*/
static Boolean
#if __GNUC__
VarMatch(GNode *ctx __attribute__((unused)), Var_Parse_State *vpstate,
VarMatch(GNode *ctx __unused, Var_Parse_State *vpstate,
char *word, Boolean addSpace, Buffer buf,
ClientData pattern)
#else
VarMatch(GNode *ctx, Var_Parse_State *vpstate,
char *word, Boolean addSpace, Buffer buf,
ClientData pattern)
#endif
{
if (Str_Match(word, (char *) pattern)) {
if (addSpace && vpstate->varSpace) {
@ -1010,15 +980,9 @@ VarSYSVMatch(GNode *ctx, Var_Parse_State *vpstate,
*-----------------------------------------------------------------------
*/
static Boolean
#if __GNUC__
VarNoMatch(GNode *ctx __attribute__((unused)), Var_Parse_State *vpstate,
VarNoMatch(GNode *ctx __unused, Var_Parse_State *vpstate,
char *word, Boolean addSpace, Buffer buf,
ClientData pattern)
#else
VarNoMatch(GNode *ctx, Var_Parse_State *vpstate,
char *word, Boolean addSpace, Buffer buf,
ClientData pattern)
#endif
{
if (!Str_Match(word, (char *) pattern)) {
if (addSpace && vpstate->varSpace) {
@ -1053,15 +1017,9 @@ VarNoMatch(GNode *ctx, Var_Parse_State *vpstate,
*-----------------------------------------------------------------------
*/
static Boolean
#if __GNUC__
VarSubstitute(GNode *ctx __attribute__((unused)), Var_Parse_State *vpstate,
VarSubstitute(GNode *ctx __unused, Var_Parse_State *vpstate,
char *word, Boolean addSpace, Buffer buf,
ClientData patternp)
#else
VarSubstitute(GNode *ctx, Var_Parse_State *vpstate,
char *word, Boolean addSpace, Buffer buf,
ClientData patternp)
#endif
{
int wordLen; /* Length of word */
char *cp; /* General pointer */
@ -1259,16 +1217,9 @@ VarREError(int err, regex_t *pat, const char *str)
*-----------------------------------------------------------------------
*/
static Boolean
#if __GNUC__
VarRESubstitute(GNode *ctx __attribute__((unused)),
Var_Parse_State *vpstate __attribute__((unused)),
VarRESubstitute(GNode *ctx __unused, Var_Parse_State *vpstate __unused,
char *word, Boolean addSpace, Buffer buf,
ClientData patternp)
#else
VarRESubstitute(GNode *ctx, Var_Parse_State *vpstate,
char *word, Boolean addSpace, Buffer buf,
ClientData patternp)
#endif
{
VarREPattern *pat;
int xrv;
@ -1406,16 +1357,9 @@ VarRESubstitute(GNode *ctx, Var_Parse_State *vpstate,
*-----------------------------------------------------------------------
*/
static Boolean
#if __GNUC__
VarLoopExpand(GNode *ctx __attribute__((unused)),
Var_Parse_State *vpstate __attribute__((unused)),
VarLoopExpand(GNode *ctx __unused, Var_Parse_State *vpstate __unused,
char *word, Boolean addSpace, Buffer buf,
ClientData loopp)
#else
VarLoopExpand(GNode *ctx, Var_Parse_State *vpstate,
char *word, Boolean addSpace, Buffer buf,
ClientData loopp)
#endif
{
VarLoop_t *loop = (VarLoop_t *) loopp;
char *s;
@ -1456,13 +1400,8 @@ VarLoopExpand(GNode *ctx, Var_Parse_State *vpstate,
*-----------------------------------------------------------------------
*/
static char *
#if __GNUC__
VarSelectWords(GNode *ctx __attribute__((unused)), Var_Parse_State *vpstate,
VarSelectWords(GNode *ctx __unused, Var_Parse_State *vpstate,
const char *str, VarSelectWords_t *seldata)
#else
VarSelectWords(GNode *ctx, Var_Parse_State *vpstate,
const char *str, VarSelectWords_t *seldata)
#endif
{
Buffer buf; /* Buffer for the new string */
Boolean addSpace; /* TRUE if need to add a space to the
@ -1721,15 +1660,9 @@ VarUniq(const char *str)
*-----------------------------------------------------------------------
*/
static char *
#if __GNUC__
VarGetPattern(GNode *ctxt, Var_Parse_State *vpstate __attribute__((unused)),
VarGetPattern(GNode *ctxt, Var_Parse_State *vpstate __unused,
int err, const char **tstr, int delim, int *flags,
int *length, VarPattern *pattern)
#else
VarGetPattern(GNode *ctxt, Var_Parse_State *vpstate,
int err, const char **tstr, int delim, int *flags,
int *length, VarPattern *pattern)
#endif
{
const char *cp;
Buffer buf = Buf_Init(0);