mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Ensure that version number starts with digits
This commit is contained in:
parent
0b726924a4
commit
21600a5f64
Notes:
git
2021-06-30 10:47:36 +09:00
1 changed files with 2 additions and 1 deletions
|
@ -75,6 +75,7 @@ PRINTF_ARGS(void rb_warn_deprecated_to_remove(const char *removal, const char *f
|
|||
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)
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue