diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2002-01-16 01:28:55 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2002-01-16 01:28:55 +0000 |
commit | 496e01e18f4d501ab034f7e71a4cb06167ff88c7 (patch) | |
tree | 3b457e6ee395b8d25e40dc6501edb7b037c62ff1 /usr.bin/make | |
parent | 51f4383f61889d34ee59c9078b745fc1afd1e51d (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 'usr.bin/make')
-rw-r--r-- | usr.bin/make/compat.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/usr.bin/make/compat.c b/usr.bin/make/compat.c index a2f91b47359..8edf215e7c7 100644 --- a/usr.bin/make/compat.c +++ b/usr.bin/make/compat.c @@ -1,5 +1,5 @@ /* $OpenPackages$ */ -/* $OpenBSD: compat.c,v 1.45 2001/12/02 00:13:16 espie Exp $ */ +/* $OpenBSD: compat.c,v 1.46 2002/01/16 01:28:54 millert Exp $ */ /* $NetBSD: compat.c,v 1.14 1996/11/06 17:59:01 christos Exp $ */ /* @@ -167,14 +167,14 @@ CompatRunCommand(cmdp, gnp) char *cmdStart; /* Start of expanded command */ char *cp, *bp = NULL; bool silent, /* Don't print command */ - errCheck, /* Check errors */ doExecute; /* Execute the command */ + volatile bool errCheck; /* Check errors */ int reason; /* Reason for child's death */ int status; /* Description of child's death */ int cpid; /* Child actually found */ int stat; /* Status of fork */ LstNode cmdNode; /* Node where current command is located */ - char **av; /* Argument vector for thing to exec */ + char ** volatile av; /* Argument vector for thing to exec */ int argc; /* Number of arguments in av or 0 if not * dynamically allocated */ bool local; /* true if command should be executed @@ -183,12 +183,6 @@ CompatRunCommand(cmdp, gnp) GNode *gn = (GNode *)gnp; static char *shargv[4] = { _PATH_BSHELL }; - /* Avoid clobbered variable warnings by forcing the compiler - * to ``unregister'' variables. */ -#if __GNUC__ - (void)&av; - (void)&errCheck; -#endif silent = gn->type & OP_SILENT; errCheck = !(gn->type & OP_IGNORE); doExecute = !noExecute; |