g++ 4.4.7 doesn't accept union field initializers:
In file included from ../../include/pub_tool_vki.h:50,
from valgrind_cpp_test.cpp:13:
../../include/vki/vki-linux.h: In function ‘vki_cmsghdr* __vki_cmsg_nxthdr(void*, __vki_kernel_size_t, vki_cmsghdr*)’:
../../include/vki/vki-linux.h:673: error: expected primary-expression before ‘.’ token
Assign value after declaration which works for any g++ version.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16437
union { \
void *in; \
D out; \
- } var = {.in = (void *) (x)}; var.out; \
+ } var; \
+ var.in = (void *) (x); var.out; \
})
// Poor man's static assert