mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
thread.c: quiet down -Wmaybe-uninitialized on gcc 7.[2-3]
Haven't tested gcc 8, yet; but gcc 6 seems fine.... git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
95abea43fe
commit
b4084d7c36
1 changed files with 9 additions and 0 deletions
9
thread.c
9
thread.c
|
@ -1195,6 +1195,14 @@ sleep_forever(rb_thread_t *th, unsigned int fl)
|
||||||
th->status = prev_status;
|
th->status = prev_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* at least gcc 7.2 and 7.3 complains about "rb_hrtime_t end"
|
||||||
|
* being uninitialized, maybe other versions, too.
|
||||||
|
*/
|
||||||
|
COMPILER_WARNING_PUSH
|
||||||
|
#if defined(__GNUC__) && __GNUC__ == 7 && __GNUC_MINOR__ <= 3
|
||||||
|
COMPILER_WARNING_IGNORED(-Wmaybe-uninitialized)
|
||||||
|
#endif
|
||||||
/*
|
/*
|
||||||
* @end is the absolute time when @ts is set to expire
|
* @end is the absolute time when @ts is set to expire
|
||||||
* Returns true if @end has past
|
* Returns true if @end has past
|
||||||
|
@ -1212,6 +1220,7 @@ hrtime_update_expire(rb_hrtime_t *timeout, const rb_hrtime_t end)
|
||||||
*timeout = end - now;
|
*timeout = end - now;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
COMPILER_WARNING_POP
|
||||||
|
|
||||||
static void
|
static void
|
||||||
sleep_hrtime(rb_thread_t *th, rb_hrtime_t rel, unsigned int fl)
|
sleep_hrtime(rb_thread_t *th, rb_hrtime_t rel, unsigned int fl)
|
||||||
|
|
Loading…
Add table
Reference in a new issue