1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

suppress GCC's -Wnonnull-compare

This particular NULL check must be a good thing to do both statically
and dynamically.
This commit is contained in:
卜部昌平 2021-09-09 15:35:18 +09:00
parent c39dd708b5
commit 64f271241d
Notes: git 2021-09-10 20:01:01 +09:00

7
gc.c
View file

@ -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)
{