[前][次][番号順一覧][スレッド一覧]

ruby-changes:65058

From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Wed, 27 Jan 2021 09:30:39 +0900 (JST)
Subject: [ruby-changes:65058] c7d1387721 (master): warnings on use of RUBY_FL_TAINT

https://git.ruby-lang.org/ruby.git/commit/?id=c7d1387721

From c7d138772167a9a489ebe062ee3027e838489e8d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?=
 <shyouhei@r...>
Date: Wed, 20 Jan 2021 11:13:06 +0900
Subject: warnings on use of RUBY_FL_TAINT

matz said in [ruby-core:94979]:
> 3.0:
>  * taint/trust/untaint/untrust non-verbose warning when called

This is it, for C extensions.
---
 include/ruby/internal/fl_type.h | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/include/ruby/internal/fl_type.h b/include/ruby/internal/fl_type.h
index 01c1d2b..6641dfe 100644
--- a/include/ruby/internal/fl_type.h
+++ b/include/ruby/internal/fl_type.h
@@ -22,6 +22,7 @@ https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/fl_type.h#L22
  */
 #include "ruby/internal/config.h"      /* for ENUM_OVER_INT */
 #include "ruby/internal/attr/artificial.h"
+#include "ruby/internal/attr/deprecated.h"
 #include "ruby/internal/attr/flag_enum.h"
 #include "ruby/internal/attr/forceinline.h"
 #include "ruby/internal/attr/noalias.h"
@@ -165,9 +166,13 @@ ruby_fl_type { https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/fl_type.h#L166
     RUBY_FL_PROMOTED1    = (1<<6),
     RUBY_FL_PROMOTED     = RUBY_FL_PROMOTED0 | RUBY_FL_PROMOTED1,
     RUBY_FL_FINALIZE     = (1<<7),
-    RUBY_FL_TAINT        = (1<<8),
+    RUBY_FL_TAINT
+    RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
+                         = (1<<8),
     RUBY_FL_SHAREABLE    = (1<<8),
-    RUBY_FL_UNTRUSTED    = RUBY_FL_TAINT,
+    RUBY_FL_UNTRUSTED
+    RBIMPL_ATTR_DEPRECATED(("trustedness turned out to be a wrong idea."))
+                         = (1<<8),
     RUBY_FL_SEEN_OBJ_ID  = (1<<9),
     RUBY_FL_EXIVAR       = (1<<10),
     RUBY_FL_FREEZE       = (1<<11),
@@ -359,6 +364,7 @@ RB_FL_REVERSE(VALUE obj, VALUE flags) https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/fl_type.h#L364
 
 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
 RBIMPL_ATTR_ARTIFICIAL()
+RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
 static inline bool
 RB_OBJ_TAINTABLE(VALUE obj)
 {
@@ -367,6 +373,7 @@ RB_OBJ_TAINTABLE(VALUE obj) https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/fl_type.h#L373
 
 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
 RBIMPL_ATTR_ARTIFICIAL()
+RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
 static inline VALUE
 RB_OBJ_TAINTED_RAW(VALUE obj)
 {
@@ -375,6 +382,7 @@ RB_OBJ_TAINTED_RAW(VALUE obj) https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/fl_type.h#L382
 
 RBIMPL_ATTR_PURE_UNLESS_DEBUG()
 RBIMPL_ATTR_ARTIFICIAL()
+RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
 static inline bool
 RB_OBJ_TAINTED(VALUE obj)
 {
@@ -382,6 +390,7 @@ RB_OBJ_TAINTED(VALUE obj) https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/fl_type.h#L390
 }
 
 RBIMPL_ATTR_ARTIFICIAL()
+RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
 static inline void
 RB_OBJ_TAINT_RAW(VALUE obj)
 {
@@ -389,6 +398,7 @@ RB_OBJ_TAINT_RAW(VALUE obj) https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/fl_type.h#L398
 }
 
 RBIMPL_ATTR_ARTIFICIAL()
+RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
 static inline void
 RB_OBJ_TAINT(VALUE obj)
 {
@@ -396,6 +406,7 @@ RB_OBJ_TAINT(VALUE obj) https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/fl_type.h#L406
 }
 
 RBIMPL_ATTR_ARTIFICIAL()
+RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
 static inline void
 RB_OBJ_INFECT_RAW(VALUE dst, VALUE src)
 {
@@ -403,6 +414,7 @@ RB_OBJ_INFECT_RAW(VALUE dst, VALUE src) https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/fl_type.h#L414
 }
 
 RBIMPL_ATTR_ARTIFICIAL()
+RBIMPL_ATTR_DEPRECATED(("taintedness turned out to be a wrong idea."))
 static inline void
 RB_OBJ_INFECT(VALUE dst, VALUE src)
 {
-- 
cgit v1.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]