sprinkle volatile.

This commit is contained in:
christos 2006-10-16 00:36:19 +00:00
parent 3fccf7e09e
commit 272937609b
3 changed files with 32 additions and 63 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: eval.c,v 1.87 2006/05/13 19:47:22 christos Exp $ */
/* $NetBSD: eval.c,v 1.88 2006/10/16 00:36:19 christos Exp $ */
/*-
* Copyright (c) 1993
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)eval.c 8.9 (Berkeley) 6/8/95";
#else
__RCSID("$NetBSD: eval.c,v 1.87 2006/05/13 19:47:22 christos Exp $");
__RCSID("$NetBSD: eval.c,v 1.88 2006/10/16 00:36:19 christos Exp $");
#endif
#endif /* not lint */
@ -664,37 +664,31 @@ int vforked = 0;
*/
STATIC void
evalcommand(union node *cmd, int flags, struct backcmd *backcmd)
evalcommand(union node *cmd, int flgs, struct backcmd *backcmd)
{
struct stackmark smark;
union node *argp;
struct arglist arglist;
struct arglist varlist;
char **argv;
int argc;
volatile int flags = flgs;
char ** volatile argv;
volatile int argc;
char **envp;
int varflag;
struct strlist *sp;
int mode;
volatile int mode;
int pip[2];
struct cmdentry cmdentry;
struct job *jp;
struct job * volatile jp;
struct jmploc jmploc;
struct jmploc *volatile savehandler = NULL;
char *volatile savecmdname;
volatile struct shparam saveparam;
struct localvar *volatile savelocalvars;
volatile int e;
char *lastarg;
const char *path = pathval();
char * volatile lastarg;
const char * volatile path = pathval();
volatile int temp_path;
#if __GNUC__
/* Avoid longjmp clobbering */
(void) &argv;
(void) &argc;
(void) &lastarg;
(void) &flags;
#endif
vforked = 0;
/* First expand the arguments. */

View File

@ -1,4 +1,4 @@
/* $NetBSD: histedit.c,v 1.39 2006/05/10 21:53:14 mrg Exp $ */
/* $NetBSD: histedit.c,v 1.40 2006/10/16 00:36:19 christos Exp $ */
/*-
* Copyright (c) 1993
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)histedit.c 8.2 (Berkeley) 5/4/95";
#else
__RCSID("$NetBSD: histedit.c,v 1.39 2006/05/10 21:53:14 mrg Exp $");
__RCSID("$NetBSD: histedit.c,v 1.40 2006/10/16 00:36:19 christos Exp $");
#endif
#endif /* not lint */
@ -225,9 +225,10 @@ int
histcmd(int argc, char **argv)
{
int ch;
const char *editor = NULL;
const char * volatile editor = NULL;
HistEvent he;
int lflg = 0, nflg = 0, rflg = 0, sflg = 0;
int lflg = 0;
volatile int nflg = 0, rflg = 0, sflg = 0;
int i, retval;
const char *firststr, *laststr;
int first, last, direction;
@ -238,19 +239,6 @@ histcmd(int argc, char **argv)
char editfile[MAXPATHLEN + 1];
FILE *efp;
#ifdef __GNUC__
/* Avoid longjmp clobbering */
(void) &editor;
(void) &lflg;
(void) &nflg;
(void) &rflg;
(void) &sflg;
(void) &firststr;
(void) &laststr;
(void) &pat;
(void) &repl;
(void) &efp;
(void) &argc;
(void) &argv;
repl = NULL; /* XXX gcc4 */
efp = NULL; /* XXX gcc4 */
#endif

View File

@ -1,4 +1,4 @@
/* $NetBSD: parser.c,v 1.62 2006/10/04 15:00:38 christos Exp $ */
/* $NetBSD: parser.c,v 1.63 2006/10/16 00:36:19 christos Exp $ */
/*-
* Copyright (c) 1991, 1993
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)parser.c 8.7 (Berkeley) 5/16/95";
#else
__RCSID("$NetBSD: parser.c,v 1.62 2006/10/04 15:00:38 christos Exp $");
__RCSID("$NetBSD: parser.c,v 1.63 2006/10/16 00:36:19 christos Exp $");
#endif
#endif /* not lint */
@ -907,35 +907,24 @@ breakloop:
dblquotep[(varnest / 32) - 1] &= ~(1 << (varnest % 32))
STATIC int
readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs)
readtoken1(int firstc, char const *syn, char *eofmark, int striptabs)
{
char const * volatile syntax = syn;
int c = firstc;
char *out;
char * volatile out;
int len;
char line[EOFMARKLEN + 1];
struct nodelist *bqlist;
int quotef;
int *dblquotep = NULL;
size_t maxnest = 32;
int dblquote;
int varnest; /* levels of variables expansion */
int arinest; /* levels of arithmetic expansion */
int parenlevel; /* levels of parens in arithmetic */
int oldstyle;
char const *prevsyntax; /* syntax before arithmetic */
#if __GNUC__
/* Avoid longjmp clobbering */
(void) &maxnest;
(void) &dblquotep;
(void) &out;
(void) &quotef;
(void) &dblquote;
(void) &varnest;
(void) &arinest;
(void) &parenlevel;
(void) &oldstyle;
(void) &prevsyntax;
(void) &syntax;
volatile int quotef;
int * volatile dblquotep = NULL;
volatile size_t maxnest = 32;
volatile int dblquote;
volatile int varnest; /* levels of variables expansion */
volatile int arinest; /* levels of arithmetic expansion */
volatile int parenlevel; /* levels of parens in arithmetic */
volatile int oldstyle;
char const * volatile prevsyntax; /* syntax before arithmetic */
#ifdef __GNUC__
prevsyntax = NULL; /* XXX gcc4 */
#endif
@ -1374,9 +1363,6 @@ parsebackq: {
struct jmploc *volatile savehandler;
int savelen;
int saveprompt;
#ifdef __GNUC__
(void) &saveprompt;
#endif
savepbq = parsebackquote;
if (setjmp(jmploc.loc)) {
@ -1469,7 +1455,8 @@ done:
if (oldstyle) {
saveprompt = doprompt;
doprompt = 0;
}
} else
saveprompt = 0;
n = list(0);