Fix order of initializers in CDS_LIST_HEAD_INIT
When using CDS_LIST_HEAD_INIT in a C++ program, we get (with clang
rather than gcc, because the error message is clearer):
/home/simark/src/urcu/tests/unit/test_build_cxx.cpp:73:13: error: ISO C++ requires field designators to be specified in declaration order; field 'prev' will be initialized after field 'next' [-Werror,-Wreorder-init-list]
.head = CDS_LIST_HEAD_INIT(list.head),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/simark/src/urcu/include/urcu/list.h:49:53: note: expanded from macro 'CDS_LIST_HEAD_INIT'
#define CDS_LIST_HEAD_INIT(name) { .prev = &(name), .next = &(name) }
^~~~~~~~~~~~~~~
/home/simark/src/urcu/tests/unit/test_build_cxx.cpp:73:13: note: previous initialization for field 'prev' is here
.head = CDS_LIST_HEAD_INIT(list.head),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/simark/src/urcu/include/urcu/list.h:49:44: note: expanded from macro 'CDS_LIST_HEAD_INIT'
#define CDS_LIST_HEAD_INIT(name) { .prev = &(name), .next = &(name) }
^~~~~~~
Fix that by swapping the initializers in CDS_LIST_HEAD_INIT.
Change-Id: Ib127b9cc128fd64f5b2ae028e093be42ca10f437
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
This page took 0.024657 seconds and 4 git commands to generate.