From 78e30df7161cc59c48eb2ea83b9add7797596036 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Mon, 6 May 2019 09:56:19 -0400 Subject: [PATCH] Cleanup: update code layout to fix old gcc warning Some CI jobs show: urcu-pointer.o 13:46:22 In file included from urcu.c:49:0: 13:46:22 urcu-wait.h:70:9: warning: missing initializer for field 'lock' of 'struct cds_wfs_stack' [-Wmissing-field-initializers] 13:46:22 struct urcu_wait_queue name = URCU_WAIT_QUEUE_HEAD_INIT(name) 13:46:22 ^ 13:46:22 urcu.c:150:8: note: in expansion of macro 'DEFINE_URCU_WAIT_QUEUE' 13:46:22 static DEFINE_URCU_WAIT_QUEUE(gp_waiters); 13:46:22 ^ 13:46:22 In file included from urcu-wait.h:27:0, 13:46:22 from urcu.c:49: 13:46:22 ../include/urcu/wfstack.h:92:18: note: 'lock' declared here 13:46:22 pthread_mutex_t lock; 13:46:22 Change code layout so not to confuse old gcc. Signed-off-by: Mathieu Desnoyers --- src/urcu-wait.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/urcu-wait.h b/src/urcu-wait.h index 94f3e35..47ac5eb 100644 --- a/src/urcu-wait.h +++ b/src/urcu-wait.h @@ -60,8 +60,13 @@ struct urcu_wait_queue { struct cds_wfs_stack stack; }; -#define URCU_WAIT_QUEUE_HEAD_INIT(name) \ - { .stack.head = CDS_WFS_END, .stack.lock = PTHREAD_MUTEX_INITIALIZER } +#define URCU_WAIT_QUEUE_HEAD_INIT(name) \ + { \ + .stack = { \ + .head = CDS_WFS_END, \ + .lock = PTHREAD_MUTEX_INITIALIZER, \ + }, \ + } #define DECLARE_URCU_WAIT_QUEUE(name) \ struct urcu_wait_queue name -- 2.39.5