summaryrefslogtreecommitdiff
path: root/bin/ed/main.c
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/ed/main.c
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/ed/main.c')
-rw-r--r--bin/ed/main.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/bin/ed/main.c b/bin/ed/main.c
index da57782a7b0..b8efb8aaf5e 100644
--- a/bin/ed/main.c
+++ b/bin/ed/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.24 2001/11/17 19:54:56 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.25 2002/01/16 01:28:54 millert Exp $ */
/* $NetBSD: main.c,v 1.3 1995/03/21 09:04:44 cgd Exp $ */
/* main.c: This file contains the main control and user-interface routines
@@ -39,7 +39,7 @@ char *copyright =
#if 0
static char *rcsid = "@(#)main.c,v 1.1 1994/02/01 00:34:42 alm Exp";
#else
-static char rcsid[] = "$OpenBSD: main.c,v 1.24 2001/11/17 19:54:56 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.25 2002/01/16 01:28:54 millert Exp $";
#endif
#endif /* not lint */
@@ -118,17 +118,12 @@ seterrmsg(char *s)
/* ed: line editor */
int
main(argc, argv)
- int argc;
- char **argv;
+ volatile int argc;
+ char ** volatile argv;
{
int c, n;
long status = 0;
-#ifdef __GNUC__
- (void)&argc;
- (void)&argv;
-#endif
-
home = getenv("HOME");
red = (n = strlen(argv[0])) > 2 && argv[0][n - 3] == 'r';