diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-08 07:49:42 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-02-08 07:49:42 +0000 |
commit | c4d09fb29928a07a617200030bd37dc332ea5d42 (patch) | |
tree | d5c66763e7d77e135468ef5a19db265208ec7656 /thread.c | |
parent | d9533a08066750fcd1f0c6188036919b6213f9a8 (diff) |
thread.c: suppress a warning
* thread.c (do_select): initialize timespec variable to suppress a
false positive maybe-uninitialized warning by gcc 7 and 8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -3785,7 +3785,11 @@ do_select(int n, rb_fdset_t *const readfds, rb_fdset_t *const writefds, rb_fdset_t MAYBE_UNUSED(orig_write); rb_fdset_t MAYBE_UNUSED(orig_except); struct timespec to; - struct timespec ts; + struct timespec ts +#if defined(__GNUC__) && (__GNUC__ == 7 || __GNUC__ == 8) + = {0, 0} +#endif + ; rb_thread_t *th = GET_THREAD(); #define do_select_update() \ |