diff options
author | Koichi Sasada <[email protected]> | 2024-04-19 13:21:55 +0900 |
---|---|---|
committer | Koichi Sasada <[email protected]> | 2024-04-19 14:28:54 +0900 |
commit | 662ce928a7fb31117bc584aad10d9c5c82689abd (patch) | |
tree | adc6ab6732574e15c7f34ad93166c9affc63bcaa /vm.c | |
parent | 7522d1bffea93989f33895da90746e40ce26d52b (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.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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; |