ruby-changes:62564
From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Thu, 13 Aug 2020 10:14:38 +0900 (JST)
Subject: [ruby-changes:62564] 69b5241c36 (master): ruby_debug_log: suppress warning
https://git.ruby-lang.org/ruby.git/commit/?id=69b5241c36 From 69b5241c360aa180550538dba1c7bf0a6cc8cc22 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: Wed, 12 Aug 2020 09:52:12 +0900 Subject: ruby_debug_log: suppress warning Old gcc (< 5 maybe?) warns that this variable is not initialized: debug.c: In function 'ruby_debug_log': debug.c:441:13: warning: 'r' may be used uninitialized in this function [-Wmaybe-uninitialized] if (r && len < MAX_DEBUG_LOG_MESSAGE_LEN) { ^ I don't know if that is true, but adding "= 0" here must harm no one. diff --git a/debug.c b/debug.c index 205e985..1525231 100644 --- a/debug.c +++ b/debug.c @@ -380,7 +380,7 @@ ruby_debug_log(const char *file, int line, const char *func_name, const char *fm https://github.com/ruby/ruby/blob/trunk/debug.c#L380 { char buff[MAX_DEBUG_LOG_MESSAGE_LEN] = {0}; int len = 0; - int r; + int r = 0; // message title if (func_name && len < MAX_DEBUG_LOG_MESSAGE_LEN) { -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/