ruby-changes:63210
From: Kazuhiro <ko1@a...>
Date: Wed, 30 Sep 2020 13:38:50 +0900 (JST)
Subject: [ruby-changes:63210] 1484b786ae (master): Suppress warnings
https://git.ruby-lang.org/ruby.git/commit/?id=1484b786ae From 1484b786aee8d411a9e2278ac6d6e44aedbf6662 Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA <zn@m...> Date: Wed, 30 Sep 2020 13:37:07 +0900 Subject: Suppress warnings ``` compiling ../mjit.c In file included from ../mjit.c:28: ../mjit_worker.c:1270:33: warning: incompatible pointer to integer conversion passing 'const struct rb_callcache *' to parameter of type 'VALUE' (aka 'unsigned long') [-Wint-conversion] assert(BUILTIN_TYPE(cc) != T_MOVED); ^~ /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert' (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0) ^ ../include/ruby/internal/value_type.h:153:23: note: passing argument to parameter 'obj' here RB_BUILTIN_TYPE(VALUE obj) ^ In file included from ../mjit.c:28: ../mjit_worker.c:1271:33: warning: incompatible pointer to integer conversion passing 'const struct rb_callable_method_entry_struct *' to parameter of type 'VALUE' (aka 'unsigned long') [-Wint-conversion] assert(BUILTIN_TYPE(vm_cc_cme(cc)) != T_MOVED); ^~~~~~~~~~~~~ /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert' (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0) ^ ../include/ruby/internal/value_type.h:153:23: note: passing argument to parameter 'obj' here RB_BUILTIN_TYPE(VALUE obj) ^ In file included from ../mjit.c:28: ../mjit_worker.c:1272:50: warning: incompatible pointer to integer conversion passing 'const struct rb_callcache *' to parameter of type 'VALUE' (aka 'unsigned long') [-Wint-conversion] assert(!rb_objspace_garbage_object_p(cc)); ^~ /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert' (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0) ^ ../gc.h:128:40: note: passing argument to parameter 'obj' here int rb_objspace_garbage_object_p(VALUE obj); ^ In file included from ../mjit.c:28: ../mjit_worker.c:1273:50: warning: incompatible pointer to integer conversion passing 'const struct rb_callable_method_entry_struct *' to parameter of type 'VALUE' (aka 'unsigned long') [-Wint-conversion] assert(!rb_objspace_garbage_object_p(vm_cc_cme(cc))); ^~~~~~~~~~~~~ /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert' (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0) ^ ../gc.h:128:40: note: passing argument to parameter 'obj' here int rb_objspace_garbage_object_p(VALUE obj); ^ 4 warnings generated. ``` diff --git a/mjit_worker.c b/mjit_worker.c index 160b8cf..461b10f 100644 --- a/mjit_worker.c +++ b/mjit_worker.c @@ -1267,10 +1267,10 @@ mjit_capture_cc_entries(const struct rb_iseq_constant_body *compiled_iseq, const https://github.com/ruby/ruby/blob/trunk/mjit_worker.c#L1267 const struct rb_callcache *cc = cc_entries[i]; if (cc && vm_cc_markable(cc)) { - assert(BUILTIN_TYPE(cc) != T_MOVED); - assert(BUILTIN_TYPE(vm_cc_cme(cc)) != T_MOVED); - assert(!rb_objspace_garbage_object_p(cc)); - assert(!rb_objspace_garbage_object_p(vm_cc_cme(cc))); + assert(BUILTIN_TYPE((VALUE)cc) != T_MOVED); + assert(BUILTIN_TYPE((VALUE)vm_cc_cme(cc)) != T_MOVED); + assert(!rb_objspace_garbage_object_p((VALUE)cc)); + assert(!rb_objspace_garbage_object_p((VALUE)vm_cc_cme(cc))); } } -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/