ruby-changes:66634
From: Nobuyoshi <ko1@a...>
Date: Wed, 30 Jun 2021 10:47:26 +0900 (JST)
Subject: [ruby-changes:66634] 21600a5f64 (master): Ensure that version number starts with digits
https://git.ruby-lang.org/ruby.git/commit/?id=21600a5f64 From 21600a5f643d7edb3ce76e0257b92848ee86568e Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Thu, 7 Jan 2021 16:35:35 +0900 Subject: Ensure that version number starts with digits --- internal/error.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/error.h b/internal/error.h index b1095b7..6fbe31b 100644 --- a/internal/error.h +++ b/internal/error.h @@ -75,6 +75,7 @@ PRINTF_ARGS(void rb_warn_deprecated_to_remove(const char *removal, const char *f https://github.com/ruby/ruby/blob/trunk/internal/error.h#L75 RBIMPL_ATTR_FORCEINLINE() static void rb_deprecated_method_to_be_removed(const char *removal) + RBIMPL_ATTR_DIAGNOSE_IF(!RUBY_VERSION_isdigit(removal[0]), "malformed version number", "error") RBIMPL_ATTR_DIAGNOSE_IF(RUBY_VERSION_SINCE(removal), "deprecated method to be removed", "error") { } @@ -82,7 +83,7 @@ rb_deprecated_method_to_be_removed(const char *removal) https://github.com/ruby/ruby/blob/trunk/internal/error.h#L83 RBIMPL_ATTR_ERROR(("deprecated")) void rb_deprecated_method_to_be_removed(const char *); # define rb_deprecated_method_to_be_removed(removal) \ - (sizeof(char[1-2*RUBY_VERSION_SINCE(removal)])!=1 ? \ + (sizeof(char[1-2*(!RUBY_VERSION_isdigit(removal[0]) || RUBY_VERSION_SINCE(removal))])!=1 ? \ rb_deprecated_method_to_be_removed(removal) : \ RBIMPL_ASSERT_NOTHING) # endif -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/