From f6f66a28c873839600d85164f267ae9fbc1e3bbe Mon Sep 17 00:00:00 2001 From: Laurent MONIN Date: Wed, 25 Jan 2006 17:03:15 +0100 Subject: [PATCH] Fix warning: variable xxx might be clobbered by longjmp or vfork, that occur with gcc 2.95.3. --- src/ecmascript/see.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ecmascript/see.c b/src/ecmascript/see.c index 4f353a79..e751ecf0 100644 --- a/src/ecmascript/see.c +++ b/src/ecmascript/see.c @@ -197,7 +197,10 @@ see_eval_stringback(struct ecmascript_interpreter *interpreter, struct SEE_input *input = SEE_input_elinks(interp, code->source); SEE_try_context_t try_ctxt; struct SEE_value result; - unsigned char *string = NULL; + /* 'volatile' qualifier prevents register allocation which fixes: + * warning: variable 'xxx' might be clobbered by 'longjmp' or 'vfork' + */ + unsigned char *volatile string = NULL; g->exec_start = time(NULL); SEE_TRY(interp, try_ctxt) { @@ -222,7 +225,10 @@ see_eval_boolback(struct ecmascript_interpreter *interpreter, struct SEE_input *input = SEE_input_elinks(interp, code->source); SEE_try_context_t try_ctxt; struct SEE_value result; - SEE_int32_t res = 0; + /* 'volatile' qualifier prevents register allocation which fixes: + * warning: variable 'xxx' might be clobbered by 'longjmp' or 'vfork' + */ + SEE_int32_t volatile res = 0; g->exec_start = time(NULL); SEE_TRY(interp, try_ctxt) {