ruby-changes:60282
From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Wed, 4 Mar 2020 12:31:13 +0900 (JST)
Subject: [ruby-changes:60282] aa44b29030 (master): suppress uninitialized variable warnings
https://git.ruby-lang.org/ruby.git/commit/?id=aa44b29030 From aa44b29030208106e75c12c3325350ebad4161b8 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, 20 Feb 2020 14:02:01 +0900 Subject: suppress uninitialized variable warnings Starting GCC 7, warnings about uninitialized variables are issued around them. Such warnings could be false positives (all versions of clang do not warn), but adding initializers there could never be bad things. diff --git a/bignum.c b/bignum.c index e9bb578..07b7cb2 100644 --- a/bignum.c +++ b/bignum.c @@ -3409,7 +3409,7 @@ rb_absint_numwords(VALUE val, size_t word_numbits, size_t *nlz_bits_ret) https://github.com/ruby/ruby/blob/trunk/bignum.c#L3409 size_t numbytes; int nlz_bits_in_msbyte; size_t numwords; - size_t nlz_bits; + size_t nlz_bits = 0; if (word_numbits == 0) return (size_t)-1; diff --git a/vm_method.c b/vm_method.c index 1bcec9b..d1afb88 100644 --- a/vm_method.c +++ b/vm_method.c @@ -894,7 +894,7 @@ rb_method_entry_at(VALUE klass, ID id) https://github.com/ruby/ruby/blob/trunk/vm_method.c#L894 static inline rb_method_entry_t* search_method(VALUE klass, ID id, VALUE *defined_class_ptr) { - rb_method_entry_t *me; + rb_method_entry_t *me = NULL; RB_DEBUG_COUNTER_INC(mc_search); -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/