aboutsummaryrefslogtreecommitdiffstats
path: root/debug.c
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2020-08-12 09:52:12 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2020-08-13 10:14:20 +0900
commit69b5241c360aa180550538dba1c7bf0a6cc8cc22 (patch)
treee97b7b39ab1b88465a43f4483cbe88a0ee642e38 /debug.c
parent1f9e25cd027ea05311ca25aa9fc09cf935cb5040 (diff)
downloadruby-69b5241c360aa180550538dba1c7bf0a6cc8cc22.tar.gz
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.
Diffstat (limited to 'debug.c')
-rw-r--r--debug.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/debug.c b/debug.c
index 205e9854fb..1525231a87 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
{
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) {