In <netinet/in.h>, we have the following definitions (simplified for presentation): /* IPv6 address */ struct in6_addr { union { uint8_t u6_addr8[16]; uint16_t u6_addr16[8]; uint32_t u6_addr32[4]; uint64_t u6_addr64[2]; } in6_u; }; #define IN6ADDR_ANY_INIT { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } #define IN6ADDR_LOOPBACK_INIT { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } IN6ADDR_ANY_INIT and IN6ADDR_LOOPBACK_INIT are initializers for static variables of the type struct in6_addr. Because of the nested struct/union/array definition, there need to be three pairs of braces around the comma-separated constant list. The current definition has only one pair of braces and hence causes compiler warnings. A test program and compiler output follow. coffee:/u/wtc/tmp 101% cat in6addr.c #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> struct in6_addr any = IN6ADDR_ANY_INIT; struct in6_addr loopback = IN6ADDR_LOOPBACK_INIT; int main() { return 0; } coffee:/u/wtc/tmp 102% gcc -Wall in6addr.c in6addr.c:5: warning: missing braces around initializer for `any.in6_u' in6addr.c:6: warning: missing braces around initializer for `loopback.in6_u'
assign to jakub
Fixed in glibc 2.1.92