summaryrefslogtreecommitdiff
path: root/ruby.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-08-31 14:58:31 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-09-25 09:50:33 +0900
commit996af2ce086249e904b2ce95ab2fcd1de7d757be (patch)
tree1b70f747a0eefc32be13f05bdb037275d1e664a1 /ruby.c
parent83ff0f74bf69650754cac020bcd4ff9adbba877e (diff)
Disable deprecation warning by the default [Feature #16345]
And `-w` option turns it on.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3481
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ruby.c b/ruby.c
index cfde2ff..9ca980d 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1109,6 +1109,7 @@ proc_options(long argc, char **argv, ruby_cmdline_options_t *opt, int envopt)
warning = 1;
ruby_verbose = Qtrue;
}
+ FEATURE_SET(opt->warn, RB_WARN_CATEGORY_ALL_BITS);
s++;
goto reswitch;
@@ -1155,6 +1156,17 @@ proc_options(long argc, char **argv, ruby_cmdline_options_t *opt, int envopt)
}
}
warning = 1;
+ switch (v) {
+ case 0:
+ FEATURE_SET_TO(opt->warn, RB_WARN_CATEGORY_ALL_BITS, 0);
+ break;
+ case 1:
+ FEATURE_SET_TO(opt->warn, 1U << RB_WARN_CATEGORY_DEPRECATED, 0);
+ break;
+ default:
+ FEATURE_SET(opt->warn, RB_WARN_CATEGORY_ALL_BITS);
+ break;
+ }
}
goto reswitch;