summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-08 07:49:42 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-08 07:49:42 +0000
commitc4d09fb29928a07a617200030bd37dc332ea5d42 (patch)
treed5c66763e7d77e135468ef5a19db265208ec7656 /thread.c
parentd9533a08066750fcd1f0c6188036919b6213f9a8 (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.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/thread.c b/thread.c
index 57adcba26a..bbf534f1b1 100644
--- a/thread.c
+++ b/thread.c
@@ -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() \