ruby-changes:67858
From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Fri, 10 Sep 2021 20:03:14 +0900 (JST)
Subject: [ruby-changes:67858] 64f271241d (master): suppress GCC's -Wnonnull-compare
https://git.ruby-lang.org/ruby.git/commit/?id=64f271241d From 64f271241d79448ec75040d97df611f86d44ecda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= <shyouhei@r...> Date: Thu, 9 Sep 2021 15:35:18 +0900 Subject: suppress GCC's -Wnonnull-compare This particular NULL check must be a good thing to do both statically and dynamically. --- gc.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gc.c b/gc.c index bae2bdd..ac280f1 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_ https://github.com/ruby/ruby/blob/trunk/gc.c#L2767 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) https://github.com/ruby/ruby/blob/trunk/gc.c#L2780 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) { -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/