From de023b68aa32240d08e420f549edcb8df7d8452c Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Thu, 13 Apr 2023 15:43:34 +0900 Subject: Disable all warning categories other than `RB_WARN_CATEGORY_ALL_BITS` --- error.c | 4 ++-- include/ruby/internal/error.h | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/error.c b/error.c index 3b1a80755c..08f26ddd4a 100644 --- a/error.c +++ b/error.c @@ -148,8 +148,8 @@ rb_syntax_error_append(VALUE exc, VALUE file, int line, int column, } static unsigned int warning_disabled_categories = ( - 1U << RB_WARN_CATEGORY_DEPRECATED | - 0); + (1U << RB_WARN_CATEGORY_DEPRECATED) | + ~RB_WARN_CATEGORY_ALL_BITS); static unsigned int rb_warning_category_mask(VALUE category) diff --git a/include/ruby/internal/error.h b/include/ruby/internal/error.h index 49e2276cb9..b30c231ac1 100644 --- a/include/ruby/internal/error.h +++ b/include/ruby/internal/error.h @@ -50,7 +50,10 @@ typedef enum { /** Warning is for experimental features. */ RB_WARN_CATEGORY_EXPERIMENTAL, - RB_WARN_CATEGORY_ALL_BITS = 0x6 /* no RB_WARN_CATEGORY_NONE bit */ + RB_WARN_CATEGORY_ALL_BITS = ( + (1U << RB_WARN_CATEGORY_DEPRECATED) | + (1U << RB_WARN_CATEGORY_EXPERIMENTAL) | + 0) } rb_warning_category_t; /** for rb_readwrite_sys_fail first argument */ -- cgit v1.2.3