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 * Copyright (c) 1993
@ -37,7 +37,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)eval.c 8.9 (Berkeley) 6/8/95"; static char sccsid[] = "@(#)eval.c 8.9 (Berkeley) 6/8/95";
#else #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
#endif /* not lint */ #endif /* not lint */
@ -664,37 +664,31 @@ int vforked = 0;
*/ */
STATIC void STATIC void
evalcommand(union node *cmd, int flags, struct backcmd *backcmd) evalcommand(union node *cmd, int flgs, struct backcmd *backcmd)
{ {
struct stackmark smark; struct stackmark smark;
union node *argp; union node *argp;
struct arglist arglist; struct arglist arglist;
struct arglist varlist; struct arglist varlist;
char **argv; volatile int flags = flgs;
int argc; char ** volatile argv;
volatile int argc;
char **envp; char **envp;
int varflag; int varflag;
struct strlist *sp; struct strlist *sp;
int mode; volatile int mode;
int pip[2]; int pip[2];
struct cmdentry cmdentry; struct cmdentry cmdentry;
struct job *jp; struct job * volatile jp;
struct jmploc jmploc; struct jmploc jmploc;
struct jmploc *volatile savehandler = NULL; struct jmploc *volatile savehandler = NULL;
char *volatile savecmdname; char *volatile savecmdname;
volatile struct shparam saveparam; volatile struct shparam saveparam;
struct localvar *volatile savelocalvars; struct localvar *volatile savelocalvars;
volatile int e; volatile int e;
char *lastarg; char * volatile lastarg;
const char *path = pathval(); const char * volatile path = pathval();
volatile int temp_path; volatile int temp_path;
#if __GNUC__
/* Avoid longjmp clobbering */
(void) &argv;
(void) &argc;
(void) &lastarg;
(void) &flags;
#endif
vforked = 0; vforked = 0;
/* First expand the arguments. */ /* 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 * Copyright (c) 1993
@ -37,7 +37,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)histedit.c 8.2 (Berkeley) 5/4/95"; static char sccsid[] = "@(#)histedit.c 8.2 (Berkeley) 5/4/95";
#else #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
#endif /* not lint */ #endif /* not lint */
@ -225,9 +225,10 @@ int
histcmd(int argc, char **argv) histcmd(int argc, char **argv)
{ {
int ch; int ch;
const char *editor = NULL; const char * volatile editor = NULL;
HistEvent he; 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; int i, retval;
const char *firststr, *laststr; const char *firststr, *laststr;
int first, last, direction; int first, last, direction;
@ -238,19 +239,6 @@ histcmd(int argc, char **argv)
char editfile[MAXPATHLEN + 1]; char editfile[MAXPATHLEN + 1];
FILE *efp; FILE *efp;
#ifdef __GNUC__ #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 */ repl = NULL; /* XXX gcc4 */
efp = NULL; /* XXX gcc4 */ efp = NULL; /* XXX gcc4 */
#endif #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 * Copyright (c) 1991, 1993
@ -37,7 +37,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)parser.c 8.7 (Berkeley) 5/16/95"; static char sccsid[] = "@(#)parser.c 8.7 (Berkeley) 5/16/95";
#else #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
#endif /* not lint */ #endif /* not lint */
@ -907,35 +907,24 @@ breakloop:
dblquotep[(varnest / 32) - 1] &= ~(1 << (varnest % 32)) dblquotep[(varnest / 32) - 1] &= ~(1 << (varnest % 32))
STATIC int 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; int c = firstc;
char *out; char * volatile out;
int len; int len;
char line[EOFMARKLEN + 1]; char line[EOFMARKLEN + 1];
struct nodelist *bqlist; struct nodelist *bqlist;
int quotef; volatile int quotef;
int *dblquotep = NULL; int * volatile dblquotep = NULL;
size_t maxnest = 32; volatile size_t maxnest = 32;
int dblquote; volatile int dblquote;
int varnest; /* levels of variables expansion */ volatile int varnest; /* levels of variables expansion */
int arinest; /* levels of arithmetic expansion */ volatile int arinest; /* levels of arithmetic expansion */
int parenlevel; /* levels of parens in arithmetic */ volatile int parenlevel; /* levels of parens in arithmetic */
int oldstyle; volatile int oldstyle;
char const *prevsyntax; /* syntax before arithmetic */ char const * volatile prevsyntax; /* syntax before arithmetic */
#if __GNUC__ #ifdef __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;
prevsyntax = NULL; /* XXX gcc4 */ prevsyntax = NULL; /* XXX gcc4 */
#endif #endif
@ -1374,9 +1363,6 @@ parsebackq: {
struct jmploc *volatile savehandler; struct jmploc *volatile savehandler;
int savelen; int savelen;
int saveprompt; int saveprompt;
#ifdef __GNUC__
(void) &saveprompt;
#endif
savepbq = parsebackquote; savepbq = parsebackquote;
if (setjmp(jmploc.loc)) { if (setjmp(jmploc.loc)) {
@ -1469,7 +1455,8 @@ done:
if (oldstyle) { if (oldstyle) {
saveprompt = doprompt; saveprompt = doprompt;
doprompt = 0; doprompt = 0;
} } else
saveprompt = 0;
n = list(0); n = list(0);