summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorKoichi Sasada <[email protected]>2024-04-19 13:21:55 +0900
committerKoichi Sasada <[email protected]>2024-04-19 14:28:54 +0900
commit662ce928a7fb31117bc584aad10d9c5c82689abd (patch)
treeadc6ab6732574e15c7f34ad93166c9affc63bcaa /vm.c
parent7522d1bffea93989f33895da90746e40ce26d52b (diff)
`RUBY_TRY_UNUSED_BLOCK_WARNING_STRICT`
`RUBY_TRY_UNUSED_BLOCK_WARNING_STRICT=1 ruby ...` will enable strict check for unused block warning. This option is only for trial to compare the results so the envname is not considered well. Should be removed before Ruby 3.4.0 release.
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/vm.c b/vm.c
index b4f6a4bf16..0b3edea58c 100644
--- a/vm.c
+++ b/vm.c
@@ -4261,6 +4261,12 @@ Init_BareVM(void)
vm->constant_cache = rb_id_table_create(0);
vm->unused_block_warning_table = st_init_numtable();
+ // TODO: remove before Ruby 3.4.0 release
+ const char *s = getenv("RUBY_TRY_UNUSED_BLOCK_WARNING_STRICT");
+ if (s && strcmp(s, "1") == 0) {
+ vm->unused_block_warning_strict = true;
+ }
+
// setup main thread
th->nt = ZALLOC(struct rb_native_thread);
th->vm = vm;