[前][次][番号順一覧][スレッド一覧]

ruby-changes:50187

From: nobu <ko1@a...>
Date: Thu, 8 Feb 2018 16:49:47 +0900 (JST)
Subject: [ruby-changes:50187] nobu:r62305 (trunk): thread.c: suppress a warning

nobu	2018-02-08 16:49:42 +0900 (Thu, 08 Feb 2018)

  New Revision: 62305

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62305

  Log:
    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.

  Modified files:
    trunk/thread.c
Index: thread.c
===================================================================
--- thread.c	(revision 62304)
+++ thread.c	(revision 62305)
@@ -3785,7 +3785,11 @@ do_select(int n, rb_fdset_t *const readf https://github.com/ruby/ruby/blob/trunk/thread.c#L3785
     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() \

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]