diff options
author | jilles <jilles@FreeBSD.org> | 2009-06-23 20:45:12 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2009-06-23 20:45:12 +0000 |
commit | 39fa9f1c9918ad9bb25af4f1bbce28c34cb2cd65 (patch) | |
tree | d592f11be2381156c3c2f8e6dd6f4bcfb70c2c6c /bin/sh/parser.c | |
parent | ecb123b94294aeb93d0b2ae271c070be043d1ba4 (diff) | |
download | FreeBSD-src-39fa9f1c9918ad9bb25af4f1bbce28c34cb2cd65.zip FreeBSD-src-39fa9f1c9918ad9bb25af4f1bbce28c34cb2cd65.tar.gz |
sh: Improve handling of setjmp/longjmp volatile:
- remove ineffective and unnecessary (void) &var; [1]
- remove some unnecessary volatile keywords
- add a necessary volatile keyword
- save the old handler before doing something that could use the saved
value
Submitted by: Christoph Mallon [1]
Approved by: ed (mentor)
Diffstat (limited to 'bin/sh/parser.c')
-rw-r--r-- | bin/sh/parser.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/bin/sh/parser.c b/bin/sh/parser.c index d17dc1a..54a80a7 100644 --- a/bin/sh/parser.c +++ b/bin/sh/parser.c @@ -898,19 +898,6 @@ readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs) int oldstyle; char const *prevsyntax; /* syntax before arithmetic */ int synentry; -#ifdef __GNUC__ - /* Avoid longjmp clobbering */ - (void) &out; - (void) "ef; - (void) &dblquote; - (void) &varnest; - (void) &arinest; - (void) &parenlevel; - (void) &oldstyle; - (void) &prevsyntax; - (void) &syntax; - (void) &synentry; -#endif startlinno = plinno; dblquote = 0; @@ -1320,13 +1307,9 @@ parsebackq: { union node *n; char *volatile str; struct jmploc jmploc; - struct jmploc *volatile savehandler; + struct jmploc *const savehandler = handler; int savelen; int saveprompt; -#ifdef __GNUC__ - /* Avoid longjmp clobbering */ - (void) &saveprompt; -#endif savepbq = parsebackquote; if (setjmp(jmploc.loc)) { @@ -1343,7 +1326,6 @@ parsebackq: { str = ckmalloc(savelen); memcpy(str, stackblock(), savelen); } - savehandler = handler; handler = &jmploc; INTON; if (oldstyle) { |