from Anon Ymous:

Convert a "(void)&" construct to volatile.
Make two variables in wwiomux.c volatile that gcc -Wextra complained about.
Do proper initialization of lcmd_arg tables and flag some variables
__unused so this will compile with gcc -Wextra.
This commit is contained in:
christos 2006-12-18 20:04:55 +00:00
parent 964e61ba35
commit 920d4bcbef
9 changed files with 57 additions and 58 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: lcmd.c,v 1.7 2003/08/07 11:17:25 agc Exp $ */
/* $NetBSD: lcmd.c,v 1.8 2006/12/18 20:04:55 christos Exp $ */
/*
* Copyright (c) 1983, 1993
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)lcmd.c 8.1 (Berkeley) 6/6/93";
#else
__RCSID("$NetBSD: lcmd.c,v 1.7 2003/08/07 11:17:25 agc Exp $");
__RCSID("$NetBSD: lcmd.c,v 1.8 2006/12/18 20:04:55 christos Exp $");
#endif
#endif /* not lint */
@ -65,7 +65,7 @@ extern struct lcmd_arg arg_unalias[];
extern struct lcmd_arg arg_unset[];
extern struct lcmd_arg arg_window[];
extern struct lcmd_arg arg_write[];
struct lcmd_arg arg_null[1] = { { 0 } };
struct lcmd_arg arg_null[1] = { { NULL, 0, 0 } };
struct lcmd_tab lcmd_tab[] = {
{ "alias", 1, l_alias, arg_alias },

View File

@ -1,4 +1,4 @@
/* $NetBSD: lcmd1.c,v 1.10 2003/08/07 11:17:26 agc Exp $ */
/* $NetBSD: lcmd1.c,v 1.11 2006/12/18 20:04:55 christos Exp $ */
/*
* Copyright (c) 1983, 1993
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)lcmd1.c 8.1 (Berkeley) 6/6/93";
#else
__RCSID("$NetBSD: lcmd1.c,v 1.10 2003/08/07 11:17:26 agc Exp $");
__RCSID("$NetBSD: lcmd1.c,v 1.11 2006/12/18 20:04:55 christos Exp $");
#endif
#endif /* not lint */
@ -63,7 +63,7 @@ struct lcmd_arg arg_window[] = {
{ "keepopen", 1, ARG_ANY },
{ "smooth", 1, ARG_ANY },
{ "shell", 1, ARG_STR|ARG_LIST },
{ 0 }
{ NULL, 0, 0 }
};
void
@ -136,7 +136,7 @@ l_window(struct value *v, struct value *a)
struct lcmd_arg arg_def_nline[] = {
{ "nlines", 1, ARG_NUM },
{ 0 }
{ NULL, 0, 0 }
};
void
@ -151,7 +151,7 @@ l_def_nline(struct value *v, struct value *a)
struct lcmd_arg arg_smooth[] = {
{ "window", 1, ARG_NUM },
{ "flag", 1, ARG_ANY },
{ 0 }
{ NULL, 0, 0 }
};
void
@ -172,7 +172,7 @@ l_smooth(struct value *v, struct value *a)
struct lcmd_arg arg_def_smooth[] = {
{ "flag", 1, ARG_ANY },
{ 0 }
{ NULL, 0, 0 }
};
void
@ -185,7 +185,7 @@ l_def_smooth(struct value *v, struct value *a)
struct lcmd_arg arg_select[] = {
{ "window", 1, ARG_NUM },
{ 0 }
{ NULL, 0, 0 }
};
void
@ -204,7 +204,7 @@ l_select(struct value *v, struct value *a)
struct lcmd_arg arg_debug[] = {
{ "flag", 1, ARG_ANY },
{ 0 }
{ NULL, 0, 0 }
};
void
@ -217,7 +217,7 @@ l_debug(struct value *v, struct value *a)
struct lcmd_arg arg_escape[] = {
{ "escapec", 1, ARG_STR },
{ 0 }
{ NULL, 0, 0 }
};
void
@ -239,11 +239,11 @@ l_escape(struct value *v, struct value *a)
struct lcmd_arg arg_label[] = {
{ "window", 1, ARG_NUM },
{ "label", 1, ARG_STR },
{ 0 }
{ NULL, 0, 0 }
};
void
l_label(struct value *v, struct value *a)
l_label(struct value *v __unused, struct value *a)
{
struct ww *w;
@ -257,7 +257,7 @@ l_label(struct value *v, struct value *a)
struct lcmd_arg arg_foreground[] = {
{ "window", 1, ARG_NUM },
{ "flag", 1, ARG_ANY },
{ 0 }
{ NULL, 0, 0 }
};
void
@ -280,7 +280,7 @@ l_foreground(struct value *v, struct value *a)
struct lcmd_arg arg_terse[] = {
{ "flag", 1, ARG_ANY },
{ 0 }
{ NULL, 0, 0 }
};
void
@ -293,7 +293,7 @@ l_terse(struct value *v, struct value *a)
struct lcmd_arg arg_source[] = {
{ "filename", 1, ARG_STR },
{ 0 }
{ NULL, 0, 0 }
};
void
@ -310,11 +310,11 @@ l_source(struct value *v, struct value *a)
struct lcmd_arg arg_write[] = {
{ "window", 1, ARG_NUM },
{ "", 0, ARG_ANY|ARG_LIST },
{ 0 }
{ NULL, 0, 0 }
};
void
l_write(struct value *v, struct value *a)
l_write(struct value *v __unused, struct value *a)
{
char buf[20];
struct ww *w;
@ -334,11 +334,11 @@ l_write(struct value *v, struct value *a)
struct lcmd_arg arg_close[] = {
{ "window", 1, ARG_ANY|ARG_LIST },
{ 0 }
{ NULL, 0, 0 }
};
void
l_close(struct value *v, struct value *a)
l_close(struct value *v __unused, struct value *a)
{
struct ww *w;
@ -352,7 +352,7 @@ l_close(struct value *v, struct value *a)
struct lcmd_arg arg_cursormodes[] = {
{ "modes", 1, ARG_NUM },
{ 0 }
{ NULL, 0, 0 }
};
void
@ -367,7 +367,7 @@ l_cursormodes(struct value *v, struct value *a)
struct lcmd_arg arg_unset[] = {
{ "variable", 1, ARG_ANY },
{ 0 }
{ NULL, 0, 0 }
};
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: lcmd2.c,v 1.13 2003/08/07 11:17:26 agc Exp $ */
/* $NetBSD: lcmd2.c,v 1.14 2006/12/18 20:04:55 christos Exp $ */
/*
* Copyright (c) 1983, 1993
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)lcmd2.c 8.1 (Berkeley) 6/6/93";
#else
__RCSID("$NetBSD: lcmd2.c,v 1.13 2003/08/07 11:17:26 agc Exp $");
__RCSID("$NetBSD: lcmd2.c,v 1.14 2006/12/18 20:04:55 christos Exp $");
#endif
#endif /* not lint */
@ -56,7 +56,7 @@ int printvar(void *, struct var *);
char *strtime(struct timeval *t);
void
l_iostat(struct value *v, struct value *a)
l_iostat(struct value *v __unused, struct value *a __unused)
{
struct ww *w;
@ -104,11 +104,11 @@ l_iostat(struct value *v, struct value *a)
struct lcmd_arg arg_time[] = {
{ "who", 1, ARG_STR },
{ 0 }
{ NULL, 0, 0 }
};
void
l_time(struct value *v, struct value *a)
l_time(struct value *v __unused, struct value *a)
{
struct ww *w;
struct rusage rusage;
@ -177,7 +177,7 @@ strtime(struct timeval *t)
}
void
l_list(struct value *v, struct value *a)
l_list(struct value *v __unused, struct value *a __unused)
{
struct ww *w, *wp;
int i;
@ -209,7 +209,7 @@ l_list(struct value *v, struct value *a)
}
void
l_variable(struct value *v, struct value *a)
l_variable(struct value *v __unused, struct value *a __unused)
{
struct ww *w;
@ -245,7 +245,7 @@ printvar(void *vw, struct var *r)
struct lcmd_arg arg_def_shell[] = {
{ "", 0, ARG_ANY|ARG_LIST },
{ 0 }
{ NULL, 0, 0 }
};
void
@ -287,7 +287,7 @@ l_def_shell(struct value *v, struct value *a)
struct lcmd_arg arg_alias[] = {
{ "", 0, ARG_STR },
{ "", 0, ARG_STR|ARG_LIST },
{ 0 }
{ NULL, 0, 0 }
};
void
@ -353,7 +353,7 @@ printalias(void *vw, struct var *a)
struct lcmd_arg arg_unalias[] = {
{ "alias", 1, ARG_STR },
{ 0 }
{ NULL, 0, 0 }
};
void
@ -367,11 +367,11 @@ l_unalias(struct value *v, struct value *a)
struct lcmd_arg arg_echo[] = {
{ "window", 1, ARG_NUM },
{ "", 0, ARG_ANY|ARG_LIST },
{ 0 }
{ NULL, 0, 0 }
};
void
l_echo(struct value *v, struct value *a)
l_echo(struct value *v __unused, struct value *a)
{
char buf[20];
struct ww *w;

View File

@ -1,4 +1,4 @@
/* $NetBSD: ttzapple.c,v 1.7 2003/08/07 11:17:33 agc Exp $ */
/* $NetBSD: ttzapple.c,v 1.8 2006/12/18 20:04:55 christos Exp $ */
/*
* Copyright (c) 1989, 1993
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)ttzapple.c 8.1 (Berkeley) 6/6/93";
#else
__RCSID("$NetBSD: ttzapple.c,v 1.7 2003/08/07 11:17:33 agc Exp $");
__RCSID("$NetBSD: ttzapple.c,v 1.8 2006/12/18 20:04:55 christos Exp $");
#endif
#endif /* not lint */
@ -380,7 +380,7 @@ zz_set_token(int t, char *s, int n)
}
void
zz_put_token(int t, char *s, int n)
zz_put_token(int t, char *s __unused, int n __unused)
{
if (tt.tt_nmodes != tt.tt_modes)
zz_setmodes(tt.tt_nmodes);

View File

@ -1,4 +1,4 @@
/* $NetBSD: wwchild.c,v 1.7 2003/08/07 11:17:36 agc Exp $ */
/* $NetBSD: wwchild.c,v 1.8 2006/12/18 20:04:55 christos Exp $ */
/*
* Copyright (c) 1983, 1993
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)wwchild.c 8.1 (Berkeley) 6/6/93";
#else
__RCSID("$NetBSD: wwchild.c,v 1.7 2003/08/07 11:17:36 agc Exp $");
__RCSID("$NetBSD: wwchild.c,v 1.8 2006/12/18 20:04:55 christos Exp $");
#endif
#endif /* not lint */
@ -47,7 +47,7 @@ __RCSID("$NetBSD: wwchild.c,v 1.7 2003/08/07 11:17:36 agc Exp $");
#include "ww.h"
void
wwchild(int dummy)
wwchild(int dummy __unused)
{
int olderrno;
struct ww **wp;

View File

@ -1,4 +1,4 @@
/* $NetBSD: wwend.c,v 1.7 2003/08/07 11:17:38 agc Exp $ */
/* $NetBSD: wwend.c,v 1.8 2006/12/18 20:04:55 christos Exp $ */
/*
* Copyright (c) 1983, 1993
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)wwend.c 8.1 (Berkeley) 6/6/93";
#else
__RCSID("$NetBSD: wwend.c,v 1.7 2003/08/07 11:17:38 agc Exp $");
__RCSID("$NetBSD: wwend.c,v 1.8 2006/12/18 20:04:55 christos Exp $");
#endif
#endif /* not lint */
@ -48,7 +48,7 @@ __RCSID("$NetBSD: wwend.c,v 1.7 2003/08/07 11:17:38 agc Exp $");
#include "xx.h"
void
wwend(int quit)
wwend(int quit __unused)
{
if (tt.tt_checkpoint) {
(void) alarm(0);
@ -63,7 +63,7 @@ wwend(int quit)
}
void
wwquit(int dummy)
wwquit(int dummy __unused)
{
wwend(1);
exit(1);

View File

@ -1,4 +1,4 @@
/* $NetBSD: wwflush.c,v 1.9 2003/08/07 11:17:39 agc Exp $ */
/* $NetBSD: wwflush.c,v 1.10 2006/12/18 20:04:55 christos Exp $ */
/*
* Copyright (c) 1983, 1993
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)wwflush.c 8.1 (Berkeley) 6/6/93";
#else
__RCSID("$NetBSD: wwflush.c,v 1.9 2003/08/07 11:17:39 agc Exp $");
__RCSID("$NetBSD: wwflush.c,v 1.10 2006/12/18 20:04:55 christos Exp $");
#endif
#endif /* not lint */
@ -115,7 +115,7 @@ wwcopyscreen(union ww_char **s1, union ww_char **s2)
}
void
wwalarm(int dummy)
wwalarm(int dummy __unused)
{
wwdocheckpoint = 1;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: wwiomux.c,v 1.12 2005/06/02 04:37:17 lukem Exp $ */
/* $NetBSD: wwiomux.c,v 1.13 2006/12/18 20:04:55 christos Exp $ */
/*
* Copyright (c) 1983, 1993
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)wwiomux.c 8.1 (Berkeley) 6/6/93";
#else
__RCSID("$NetBSD: wwiomux.c,v 1.12 2005/06/02 04:37:17 lukem Exp $");
__RCSID("$NetBSD: wwiomux.c,v 1.13 2006/12/18 20:04:55 christos Exp $");
#endif
#endif /* not lint */
@ -67,9 +67,10 @@ void
wwiomux(void)
{
struct ww *w;
int nfd, dostdin;
int nfd;
int volatile dostdin; /* avoid longjmp clobbering */
char volatile c; /* avoid longjmp clobbering */
char *p;
char c;
int millis;
char noblock = 0;
static struct pollfd *pfd = NULL;

View File

@ -1,4 +1,4 @@
/* $NetBSD: wwspawn.c,v 1.9 2003/08/07 11:17:45 agc Exp $ */
/* $NetBSD: wwspawn.c,v 1.10 2006/12/18 20:04:55 christos Exp $ */
/*
* Copyright (c) 1983, 1993
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)wwspawn.c 8.1 (Berkeley) 6/6/93";
#else
__RCSID("$NetBSD: wwspawn.c,v 1.9 2003/08/07 11:17:45 agc Exp $");
__RCSID("$NetBSD: wwspawn.c,v 1.10 2006/12/18 20:04:55 christos Exp $");
#endif
#endif /* not lint */
@ -54,12 +54,10 @@ wwspawn(struct ww *wp, char *file, char **argv)
{
int pid;
int ret;
char erred = 0;
char volatile erred;
sigset_t nsigset, osigset;
#ifdef __GNUC__ /* XXX variable `erred ' might be clobbered by ... `vfork' */
(void)&erred;
#endif
erred = 0;
sigemptyset(&nsigset);
sigaddset(&nsigset, SIGCHLD);