From cfe9dcb886b225e5607e0bc13b591f9c4a020daa Mon Sep 17 00:00:00 2001 From: akr Date: Sat, 28 Feb 2009 11:12:36 +0000 Subject: * eval_error.c (error_print): use volatile to suppress warnings. * vm_eval.c (eval_string_with_cref): ditto. * thread.c (rb_exec_recursive): ditto. * eval_jump.c (rb_exec_end_proc): ditto. * eval.c (ruby_exec_node): ditto. (rb_longjmp): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 13 +++++++++++++ eval.c | 6 +++--- eval_error.c | 6 +++--- eval_jump.c | 3 ++- thread.c | 2 +- vm_eval.c | 2 +- 6 files changed, 23 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7139acd823..cd0e77024b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +Sat Feb 28 20:09:40 2009 Tanaka Akira + + * eval_error.c (error_print): use volatile to suppress warnings. + + * vm_eval.c (eval_string_with_cref): ditto. + + * thread.c (rb_exec_recursive): ditto. + + * eval_jump.c (rb_exec_end_proc): ditto. + + * eval.c (ruby_exec_node): ditto. + (rb_longjmp): ditto. + Sat Feb 28 18:28:58 2009 Tanaka Akira * ext/socket/ancdata.c (ancillary_unix_rights): check message type. diff --git a/eval.c b/eval.c index 051fb89019..8040e8b585 100644 --- a/eval.c +++ b/eval.c @@ -193,7 +193,7 @@ ruby_cleanup(int ex) int ruby_exec_node(void *n, const char *file) { - int state; + volatile int state; VALUE iseq = (VALUE)n; rb_thread_t *th = GET_THREAD(); @@ -332,13 +332,13 @@ rb_frozen_class_p(VALUE klass) NORETURN(static void rb_longjmp(int, VALUE)); static void -rb_longjmp(int tag, VALUE mesg) +rb_longjmp(int tag, volatile VALUE mesg) { VALUE at; VALUE e; rb_thread_t *th = GET_THREAD(); const char *file; - int line = 0; + volatile int line = 0; if (rb_thread_set_raised(th)) { th->errinfo = exception_error; diff --git a/eval_error.c b/eval_error.c index 15233e7c1b..ce6bd234f1 100644 --- a/eval_error.c +++ b/eval_error.c @@ -66,11 +66,11 @@ set_backtrace(VALUE info, VALUE bt) static void error_print(void) { - VALUE errat = Qnil; /* OK */ + volatile VALUE errat = Qnil; /* OK */ VALUE errinfo = GET_THREAD()->errinfo; volatile VALUE eclass, e; - const char *einfo; - long elen; + const char *volatile einfo; + volatile long elen; if (NIL_P(errinfo)) return; diff --git a/eval_jump.c b/eval_jump.c index f474844ba8..18b6835c9c 100644 --- a/eval_jump.c +++ b/eval_jump.c @@ -101,7 +101,8 @@ rb_mark_end_proc(void) void rb_exec_end_proc(void) { - struct end_proc_data *link, *tmp; + struct end_proc_data *volatile link; + struct end_proc_data *tmp; int status; volatile int safe = rb_safe_level(); diff --git a/thread.c b/thread.c index 38e46c3daa..a2c882cfff 100644 --- a/thread.c +++ b/thread.c @@ -3345,7 +3345,7 @@ recursive_pop(VALUE hash, VALUE obj) VALUE rb_exec_recursive(VALUE (*func) (VALUE, VALUE, int), VALUE obj, VALUE arg) { - VALUE hash = rb_thread_local_aref(rb_thread_current(), recursive_key); + volatile VALUE hash = rb_thread_local_aref(rb_thread_current(), recursive_key); VALUE objid = rb_obj_id(obj); if (recursive_check(hash, objid)) { diff --git a/vm_eval.c b/vm_eval.c index 1b6ffe28ba..50dea4c05b 100644 --- a/vm_eval.c +++ b/vm_eval.c @@ -688,7 +688,7 @@ rb_each(VALUE obj) } static VALUE -eval_string_with_cref(VALUE self, VALUE src, VALUE scope, NODE *cref, const char *file, int line) +eval_string_with_cref(VALUE self, VALUE src, VALUE scope, NODE *cref, const char *volatile file, volatile int line) { int state; VALUE result = Qundef; -- cgit v1.2.3