mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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.
This commit is contained in:
parent
1f9e25cd02
commit
69b5241c36
Notes:
git
2020-08-13 10:14:44 +09:00
1 changed files with 1 additions and 1 deletions
2
debug.c
2
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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue