diff options
author | 卜部昌平 <[email protected]> | 2021-09-09 15:35:18 +0900 |
---|---|---|
committer | 卜部昌平 <[email protected]> | 2021-09-10 20:00:06 +0900 |
commit | 64f271241d79448ec75040d97df611f86d44ecda (patch) | |
tree | bcd9d8b6b39300404d7a9ac4f2dc5420e534916c /gc.c | |
parent | c39dd708b5f59766ce75c88e92d92ebcaa1df341 (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.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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) { |