From 85e9f2879373aa496c5c3c7f900ba4869a9ca3f7 Mon Sep 17 00:00:00 2001 From: shyouhei Date: Mon, 9 Apr 2018 03:24:21 +0000 Subject: [PATCH] offsetof(type, foo.bar) is (arguably) a GCCism clang -Wextended-offsetof warns this line. CF: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2031.htm git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread_sync.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/thread_sync.c b/thread_sync.c index 705fdb942d..b592104ae8 100644 --- a/thread_sync.c +++ b/thread_sync.c @@ -1459,7 +1459,8 @@ rb_thread_sync_reset_all(void) list_head_init(queue_waitq(q)); q->num_waiting = 0; } - list_for_each(&szqueue_list, sq, q.live) { + list_for_each(&szqueue_list, q, live) { + sq = container_of(q, struct rb_szqueue, q); list_head_init(szqueue_waitq(sq)); list_head_init(szqueue_pushq(sq)); sq->num_waiting_push = 0;