Skip to content

Commit

Permalink
spec/ruby/optional/capi/ext: suppress warnings
Browse files Browse the repository at this point in the history
These warnings are okay here.
  • Loading branch information
shyouhei committed Sep 10, 2021
1 parent 488ef54 commit b563b9c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/ruby/optional/capi/ext/object_spec.c
Expand Up @@ -151,10 +151,20 @@ static VALUE object_specs_rb_obj_method(VALUE self, VALUE obj, VALUE method) {
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;
Expand Down
9 changes: 9 additions & 0 deletions spec/ruby/optional/capi/ext/string_spec.c
Expand Up @@ -251,6 +251,13 @@ VALUE string_spec_rb_str_new5(VALUE self, VALUE str, VALUE ptr, VALUE len) {
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));
}
Expand All @@ -259,6 +266,8 @@ VALUE string_spec_rb_tainted_str_new2(VALUE self, VALUE str) {
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);
}
Expand Down

0 comments on commit b563b9c

Please sign in to comment.