From c4d09fb29928a07a617200030bd37dc332ea5d42 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 8 Feb 2018 07:49:42 +0000 Subject: 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 --- thread.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'thread.c') 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() \ -- cgit v1.2.3