Skip to content

Commit 1675b69

Browse files
committed
spec/ruby/optional/capi/ext: suppress warnings
These warnings are okay here.
1 parent f176180 commit 1675b69

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

spec/ruby/optional/capi/ext/object_spec.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,20 @@ static VALUE object_specs_rb_obj_method(VALUE self, VALUE obj, VALUE method) {
151151
return rb_obj_method(obj, method);
152152
}
153153

154+
155+
RBIMPL_WARNING_PUSH()
156+
#if RBIMPL_HAS_WARNING("-Wdeprecated-declarations") || RBIMPL_COMPILER_SINCE(GCC, 4, 6, 0)
157+
/* GCC 4.5 introduced __attribute__((__deprecated__)) */
158+
/* GCC 4.6 introduced #pragma GCC diagnostic push */
159+
RBIMPL_WARNING_IGNORED(-Wdeprecated-declarations)
160+
#endif
161+
154162
static VALUE object_spec_rb_obj_taint(VALUE self, VALUE obj) {
155163
return rb_obj_taint(obj);
156164
}
157165

166+
RBIMPL_WARNING_POP()
167+
158168
static VALUE so_require(VALUE self) {
159169
rb_require("fixtures/foo");
160170
return Qnil;

spec/ruby/optional/capi/ext/string_spec.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,13 @@ VALUE string_spec_rb_str_new5(VALUE self, VALUE str, VALUE ptr, VALUE len) {
251251
return rb_str_new5(str, RSTRING_PTR(ptr), FIX2INT(len));
252252
}
253253

254+
RBIMPL_WARNING_PUSH()
255+
#if RBIMPL_HAS_WARNING("-Wdeprecated-declarations") || RBIMPL_COMPILER_SINCE(GCC, 4, 6, 0)
256+
/* GCC 4.5 introduced __attribute__((__deprecated__)) */
257+
/* GCC 4.6 introduced #pragma GCC diagnostic push */
258+
RBIMPL_WARNING_IGNORED(-Wdeprecated-declarations)
259+
#endif
260+
254261
VALUE string_spec_rb_tainted_str_new(VALUE self, VALUE str, VALUE len) {
255262
return rb_tainted_str_new(RSTRING_PTR(str), FIX2INT(len));
256263
}
@@ -259,6 +266,8 @@ VALUE string_spec_rb_tainted_str_new2(VALUE self, VALUE str) {
259266
return rb_tainted_str_new2(RSTRING_PTR(str));
260267
}
261268

269+
RBIMPL_WARNING_POP()
270+
262271
VALUE string_spec_rb_str_plus(VALUE self, VALUE str1, VALUE str2) {
263272
return rb_str_plus(str1, str2);
264273
}

0 commit comments

Comments
 (0)