summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2021-09-09 15:35:18 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2021-09-10 20:00:06 +0900
commit64f271241d79448ec75040d97df611f86d44ecda (patch)
treebcd9d8b6b39300404d7a9ac4f2dc5420e534916c /gc.c
parentc39dd708b5f59766ce75c88e92d92ebcaa1df341 (diff)
suppress GCC's -Wnonnull-compare
This particular NULL check must be a good thing to do both statically and dynamically.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4815
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index bae2bdd618..ac280f1e2d 100644
--- a/gc.c
+++ b/gc.c
@@ -2767,6 +2767,11 @@ rb_data_object_zalloc(VALUE klass, size_t size, RUBY_DATA_FUNC dmark, RUBY_DATA_
return obj;
}
+COMPILER_WARNING_PUSH
+#if __has_warning("-Wnonnull-compare") || GCC_VERSION_SINCE(6, 1, 0)
+COMPILER_WARNING_IGNORED(-Wnonnull-compare)
+#endif
+
VALUE
rb_data_typed_object_wrap(VALUE klass, void *datap, const rb_data_type_t *type)
{
@@ -2775,6 +2780,8 @@ rb_data_typed_object_wrap(VALUE klass, void *datap, const rb_data_type_t *type)
return newobj_of(klass, T_DATA, (VALUE)type, (VALUE)1, (VALUE)datap, type->flags & RUBY_FL_WB_PROTECTED, sizeof(RVALUE));
}
+COMPILER_WARNING_POP
+
VALUE
rb_data_typed_object_zalloc(VALUE klass, size_t size, const rb_data_type_t *type)
{