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

ruby-changes:67852

From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Fri, 10 Sep 2021 20:03:11 +0900 (JST)
Subject: [ruby-changes:67852] b563b9c48f (master): spec/ruby/optional/capi/ext: suppress warnings

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

From b563b9c48f09093b94554867fe8a71de6c27a37b 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: Thu, 9 Sep 2021 18:19:07 +0900
Subject: spec/ruby/optional/capi/ext: suppress warnings

These warnings are okay here.
---
 spec/ruby/optional/capi/ext/object_spec.c | 10 ++++++++++
 spec/ruby/optional/capi/ext/string_spec.c |  9 +++++++++
 2 files changed, 19 insertions(+)

diff --git a/spec/ruby/optional/capi/ext/object_spec.c b/spec/ruby/optional/capi/ext/object_spec.c
index 950c081..eae2446 100644
--- a/spec/ruby/optional/capi/ext/object_spec.c
+++ b/spec/ruby/optional/capi/ext/object_spec.c
@@ -151,10 +151,20 @@ static VALUE object_specs_rb_obj_method(VALUE self, VALUE obj, VALUE method) { https://github.com/ruby/ruby/blob/trunk/spec/ruby/optional/capi/ext/object_spec.c#L151
   return rb_obj_method(obj, method);
 }
 
+
+RBIMPL_WARNING_PUSH()
+#if RBIMPL_HAS_WARNING("-Wdeprecated-declarations") || RBIMPL_COMPILER_SINCE(GCC, 4, 6, 0)
+/* GCC 4.5 introduced __attribute__((__deprecated__)) */
+/* GCC 4.6 introduced #pragma GCC diagnostic push */
+RBIMPL_WARNING_IGNORED(-Wdeprecated-declarations)
+#endif
+
 static VALUE object_spec_rb_obj_taint(VALUE self, VALUE obj) {
   return rb_obj_taint(obj);
 }
 
+RBIMPL_WARNING_POP()
+
 static VALUE so_require(VALUE self) {
   rb_require("fixtures/foo");
   return Qnil;
diff --git a/spec/ruby/optional/capi/ext/string_spec.c b/spec/ruby/optional/capi/ext/string_spec.c
index fb9af83..7977a2f 100644
--- a/spec/ruby/optional/capi/ext/string_spec.c
+++ b/spec/ruby/optional/capi/ext/string_spec.c
@@ -251,6 +251,13 @@ VALUE string_spec_rb_str_new5(VALUE self, VALUE str, VALUE ptr, VALUE len) { https://github.com/ruby/ruby/blob/trunk/spec/ruby/optional/capi/ext/string_spec.c#L251
   return rb_str_new5(str, RSTRING_PTR(ptr), FIX2INT(len));
 }
 
+RBIMPL_WARNING_PUSH()
+#if RBIMPL_HAS_WARNING("-Wdeprecated-declarations") || RBIMPL_COMPILER_SINCE(GCC, 4, 6, 0)
+/* GCC 4.5 introduced __attribute__((__deprecated__)) */
+/* GCC 4.6 introduced #pragma GCC diagnostic push */
+RBIMPL_WARNING_IGNORED(-Wdeprecated-declarations)
+#endif
+
 VALUE string_spec_rb_tainted_str_new(VALUE self, VALUE str, VALUE len) {
   return rb_tainted_str_new(RSTRING_PTR(str), FIX2INT(len));
 }
@@ -259,6 +266,8 @@ VALUE string_spec_rb_tainted_str_new2(VALUE self, VALUE str) { https://github.com/ruby/ruby/blob/trunk/spec/ruby/optional/capi/ext/string_spec.c#L266
   return rb_tainted_str_new2(RSTRING_PTR(str));
 }
 
+RBIMPL_WARNING_POP()
+
 VALUE string_spec_rb_str_plus(VALUE self, VALUE str1, VALUE str2) {
   return rb_str_plus(str1, str2);
 }
-- 
cgit v1.1


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

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