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

ruby-changes:29985

From: nobu <ko1@a...>
Date: Thu, 18 Jul 2013 15:46:02 +0900 (JST)
Subject: [ruby-changes:29985] nobu:r42037 (trunk): ruby.h: error only in the core

nobu	2013-07-18 15:45:50 +0900 (Thu, 18 Jul 2013)

  New Revision: 42037

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42037

  Log:
    ruby.h: error only in the core
    
    * include/ruby/ruby.h (RUBY_SAFE_LEVEL_CHECK): make only
      rb_set_safe_level(4) an error always but make rb_secure(4) an error
      only in the core.  [ruby-dev:47517] [Bug #8652]

  Modified files:
    trunk/ChangeLog
    trunk/include/ruby/ruby.h

Index: include/ruby/ruby.h
===================================================================
--- include/ruby/ruby.h	(revision 42036)
+++ include/ruby/ruby.h	(revision 42037)
@@ -567,14 +567,19 @@ void rb_secure(int); https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L567
 int rb_safe_level(void);
 void rb_set_safe_level(int);
 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
-int ruby_safe_level_4(void) __attribute__((error("$SAFE=4 is obsolete")));
+int ruby_safe_level_4_error(void) __attribute__((error("$SAFE=4 is obsolete")));
+# ifdef RUBY_EXPORT
+#   define ruby_safe_level_4_warning() ruby_safe_level_4_error()
+# else
+int ruby_safe_level_4_warning(void) __attribute__((warning("$SAFE=4 is obsolete")));
+# endif
 #define RUBY_SAFE_LEVEL_INVALID_P(level) \
     __extension__(__builtin_constant_p(level) && \
 		  ((level) < 0 || RUBY_SAFE_LEVEL_MAX < (level)))
-#define RUBY_SAFE_LEVEL_CHECK(level) \
-    (RUBY_SAFE_LEVEL_INVALID_P(level) ? ruby_safe_level_4() : (level))
-#define rb_secure(level) rb_secure(RUBY_SAFE_LEVEL_CHECK(level))
-#define rb_set_safe_level(level) rb_set_safe_level(RUBY_SAFE_LEVEL_CHECK(level))
+#define RUBY_SAFE_LEVEL_CHECK(level, type) \
+    (RUBY_SAFE_LEVEL_INVALID_P(level) ? ruby_safe_level_4_##type() : (level))
+#define rb_secure(level) rb_secure(RUBY_SAFE_LEVEL_CHECK(level, warning))
+#define rb_set_safe_level(level) rb_set_safe_level(RUBY_SAFE_LEVEL_CHECK(level, error))
 #endif
 void rb_set_safe_level_force(int);
 void rb_secure_update(VALUE);
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 42036)
+++ ChangeLog	(revision 42037)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Jul 18 15:45:47 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* include/ruby/ruby.h (RUBY_SAFE_LEVEL_CHECK): make only
+	  rb_set_safe_level(4) an error always but make rb_secure(4) an error
+	  only in the core.  [ruby-dev:47517] [Bug #8652]
+
 Thu Jul 18 15:42:01 2013  Koichi Sasada  <ko1@a...>
 
 	* include/ruby/ruby.h: fix spell miss.

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

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