aboutsummaryrefslogtreecommitdiffstats
path: root/cont.c
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-07 23:47:59 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-07 23:47:59 +0000
commit6626f07017ff7b0065790363c0f3d6a3fc7f149f (patch)
tree620e9dc22b2c0e75900df06da6e6146d273f30b0 /cont.c
parent8e385ad70b3571dbdce5ea48524b358d9630238a (diff)
downloadruby-6626f07017ff7b0065790363c0f3d6a3fc7f149f.tar.gz
Add volatile to a suppress warning.
Without the fix, the following warning is shown: compiling cont.c cont.c: In function ‘rb_callcc’: cont.c:949:39: warning: passing argument 1 of ‘cont_capture’ discards ‘volatile’ qualifier from pointer target type [-Wdiscarded-qualifiers] volatile VALUE val = cont_capture(&called); ^ cont.c:473:1: note: expected ‘int * volatile’ but argument is of type ‘volatile int *’ cont_capture(int *volatile stat) ^ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'cont.c')
-rw-r--r--cont.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cont.c b/cont.c
index 09127733c3..b7ef391581 100644
--- a/cont.c
+++ b/cont.c
@@ -161,7 +161,7 @@ static VALUE rb_eFiberError;
if (!(ptr)) rb_raise(rb_eFiberError, "uninitialized fiber"); \
} while (0)
-NOINLINE(static VALUE cont_capture(int *volatile stat));
+NOINLINE(static VALUE cont_capture(volatile int *volatile stat));
#define THREAD_MUST_BE_RUNNING(th) do { \
if (!(th)->tag) rb_raise(rb_eThreadError, "not running thread"); \
@@ -470,7 +470,7 @@ cont_new(VALUE klass)
}
static VALUE
-cont_capture(int *volatile stat)
+cont_capture(volatile int *volatile stat)
{
rb_context_t *volatile cont;
rb_thread_t *th = GET_THREAD();