summaryrefslogtreecommitdiffstats
path: root/lib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-10-20 20:10:01 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-10-20 20:10:01 -0700
commitca9d41f19051d34bad12ea3b703ae20ba1902773 (patch)
tree54b9fb085e2665b52622999504eb2086fac563b9 /lib.c
parentced08a126bdc46dd3c5ee057ebc3bec4fece8a19 (diff)
downloadtxr-ca9d41f19051d34bad12ea3b703ae20ba1902773.tar.gz
txr-ca9d41f19051d34bad12ea3b703ae20ba1902773.tar.bz2
txr-ca9d41f19051d34bad12ea3b703ae20ba1902773.zip
obj_print: use of volatile.
* lib.c (obj_print): The ret variable doesn't have to be volatile qualified, because it is never modified after setting an exception handler, and then accessed in the cleanup. On the other hand, the ctx variable is manipulated this way and must be volatile.
Diffstat (limited to 'lib.c')
-rw-r--r--lib.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib.c b/lib.c
index 1b3996c9..834685b4 100644
--- a/lib.c
+++ b/lib.c
@@ -9427,11 +9427,12 @@ tail:
val obj_print(val obj, val stream)
{
- volatile val ret = nil;
+ val ret = nil;
val out = default_arg(stream, std_output);
val save_mode = get_indent_mode(out);
val save_indent = get_indent(out);
- struct strm_ctx *ctx_orig = get_ctx(out), *ctx = ctx_orig, ctx_struct;
+ struct strm_ctx *ctx_orig = get_ctx(out);
+ struct strm_ctx *volatile ctx = ctx_orig, ctx_struct;
uw_simple_catch_begin;
@@ -9467,7 +9468,8 @@ val obj_pprint(val obj, val stream)
val out = default_arg(stream, std_output);
val save_mode = get_indent_mode(out);
val save_indent = get_indent(out);
- struct strm_ctx *ctx_orig = get_ctx(out), *ctx = ctx_orig, ctx_struct;
+ struct strm_ctx *ctx_orig = get_ctx(out);
+ struct strm_ctx *volatile ctx = ctx_orig, ctx_struct;
uw_simple_catch_begin;