aboutsummaryrefslogtreecommitdiffstats
path: root/thread.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-25 21:33:55 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-25 21:33:55 +0000
commitb196c6b1ad4868086ca1bf3b843e1cdf663593d7 (patch)
treefa7a431badb82624841485b730b617ba38ee362f /thread.c
parent253bbe01f23f10c75da9a5d6f7a2829dfe46475a (diff)
downloadruby-b196c6b1ad4868086ca1bf3b843e1cdf663593d7.tar.gz
thread.c: quiet down -Wmaybe-uninitialized on gcc 7.[2-3]
Haven't tested gcc 8, yet; but gcc 6 seems fine.... git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/thread.c b/thread.c
index a1d5ddee73..d350c9d364 100644
--- a/thread.c
+++ b/thread.c
@@ -1196,6 +1196,14 @@ sleep_forever(rb_thread_t *th, unsigned int fl)
}
/*
+ * 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 *timeout, const rb_hrtime_t end)
*timeout = end - now;
return 0;
}
+COMPILER_WARNING_POP
static void
sleep_hrtime(rb_thread_t *th, rb_hrtime_t rel, unsigned int fl)