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:
parent
c39dd708b5
commit
64f271241d
Notes:
git
2021-09-10 20:01:01 +09:00
1 changed files with 7 additions and 0 deletions
7
gc.c
7
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)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue