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?= Date: Thu, 20 Feb 2020 14:02:01 +0900 Subject: [PATCH] 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. --- bignum.c | 2 +- vm_method.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bignum.c b/bignum.c index e9bb5780b5..07b7cb2101 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) 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 1bcec9bc5f..d1afb88e40 100644 --- a/vm_method.c +++ b/vm_method.c @@ -894,7 +894,7 @@ rb_method_entry_at(VALUE klass, ID id) 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);