summaryrefslogtreecommitdiff
path: root/bin/ksh
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-01-16 01:28:55 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-01-16 01:28:55 +0000
commit496e01e18f4d501ab034f7e71a4cb06167ff88c7 (patch)
tree3b457e6ee395b8d25e40dc6501edb7b037c62ff1 /bin/ksh
parent51f4383f61889d34ee59c9078b745fc1afd1e51d (diff)
Use the volatile specifier to fix warnings about variables being
clobbered by longjmp / vfork instead of the gcc "(void)&foo;" hack.
Diffstat (limited to 'bin/ksh')
-rw-r--r--bin/ksh/exec.c8
-rw-r--r--bin/ksh/lex.c8
2 files changed, 5 insertions, 11 deletions
diff --git a/bin/ksh/exec.c b/bin/ksh/exec.c
index 137b0ba8502..270857662f8 100644
--- a/bin/ksh/exec.c
+++ b/bin/ksh/exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec.c,v 1.24 2001/07/19 16:46:27 millert Exp $ */
+/* $OpenBSD: exec.c,v 1.25 2002/01/16 01:28:54 millert Exp $ */
/*
* execute command tree
@@ -450,7 +450,7 @@ comexec(t, tp, ap, flags)
int volatile flags;
{
int i;
- int rv = 0;
+ volatile int rv = 0;
register char *cp;
register char **lastp;
static struct op texec; /* Must be static (XXX but why?) */
@@ -458,10 +458,6 @@ comexec(t, tp, ap, flags)
int keepasn_ok;
int fcflags = FC_BI|FC_FUNC|FC_PATH;
-#ifdef __GNUC__
- (void)&rv;
-#endif
-
#ifdef KSH
/* snag the last argument for $_ XXX not the same as at&t ksh,
* which only seems to set $_ after a newline (but not in
diff --git a/bin/ksh/lex.c b/bin/ksh/lex.c
index ecba1a46910..d28c5aaec33 100644
--- a/bin/ksh/lex.c
+++ b/bin/ksh/lex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lex.c,v 1.14 1999/06/15 01:18:34 millert Exp $ */
+/* $OpenBSD: lex.c,v 1.15 2002/01/16 01:28:54 millert Exp $ */
/*
* lexical analysis and source input
@@ -1124,11 +1124,9 @@ set_prompt(to, s)
*/
{
struct shf *shf;
- char *ps1;
+ char * volatile ps1;
Area *saved_atemp;
-#ifdef __GNUC__
- (void)&ps1;
-#endif
+
ps1 = str_val(global("PS1"));
shf = shf_sopen((char *) 0, strlen(ps1) * 2,
SHF_WR | SHF_DYNAMIC, (struct shf *) 0);