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

ruby-changes:52328

From: normal <ko1@a...>
Date: Sun, 26 Aug 2018 06:34:05 +0900 (JST)
Subject: [ruby-changes:52328] normal:r64536 (trunk): thread.c: quiet down -Wmaybe-uninitialized on gcc 7.[2-3]

normal	2018-08-26 06:33:55 +0900 (Sun, 26 Aug 2018)

  New Revision: 64536

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

  Log:
    thread.c: quiet down -Wmaybe-uninitialized on gcc 7.[2-3]
    
    Haven't tested gcc 8, yet; but gcc 6 seems fine....

  Modified files:
    trunk/thread.c
Index: thread.c
===================================================================
--- thread.c	(revision 64535)
+++ thread.c	(revision 64536)
@@ -1196,6 +1196,14 @@ sleep_forever(rb_thread_t *th, unsigned https://github.com/ruby/ruby/blob/trunk/thread.c#L1196
 }
 
 /*
+ * 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
  * Returns true if @end has past
  * Updates @ts and returns false otherwise
@@ -1212,6 +1220,7 @@ hrtime_update_expire(rb_hrtime_t *timeou https://github.com/ruby/ruby/blob/trunk/thread.c#L1220
     *timeout = end - now;
     return 0;
 }
+COMPILER_WARNING_POP
 
 static void
 sleep_hrtime(rb_thread_t *th, rb_hrtime_t rel, unsigned int fl)

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

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