ruby-changes:58577
From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Tue, 5 Nov 2019 13:57:01 +0900 (JST)
Subject: [ruby-changes:58577] 7c07300491 (master): let the .bss section initialize static variables
https://git.ruby-lang.org/ruby.git/commit/?id=7c07300491 From 7c07300491de502cd94e07fcbf9b30f2df31a0d5 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: Tue, 5 Nov 2019 13:46:08 +0900 Subject: let the .bss section initialize static variables ISO/IEC 9899:1999 section 6.7.8 specifies the values of static storage which are not explicitly initialized. According to that these initializers can be omitted. Doing so improvoes future compatibility against addition / deletion of the fields of this struct. diff --git a/internal.h b/internal.h index 0c245c3..703dd57 100644 --- a/internal.h +++ b/internal.h @@ -2395,12 +2395,12 @@ RUBY_FUNC_NONNULL(1, bool rb_method_basic_definition_p_with_cc(struct rb_call_da https://github.com/ruby/ruby/blob/trunk/internal.h#L2395 #ifdef __GNUC__ # define rb_funcallv(recv, mid, argc, argv) \ __extension__({ \ - static struct rb_call_data rb_funcallv_data = { { 0, }, { 0, }, }; \ + static struct rb_call_data rb_funcallv_data; \ rb_funcallv_with_cc(&rb_funcallv_data, recv, mid, argc, argv); \ }) # define rb_method_basic_definition_p(klass, mid) \ __extension__({ \ - static struct rb_call_data rb_mbdp = { { 0, }, { 0, }, }; \ + static struct rb_call_data rb_mbdp; \ (klass == Qfalse) ? /* hidden object cannot be overridden */ true : \ rb_method_basic_definition_p_with_cc(&rb_mbdp, klass, mid); \ }) -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/