Description of problem: Mingw's definition of struct in6_addr requires multiple levels of {} to silence gcc's -Wmissing-braces; however, the definition in <ws2tcpip.h> lacks these. It would also be nice if mingw could provide the standardized <netinet/in.h> as the POSIX name for getting at these macros. Version-Release number of selected component (if applicable): mingw32-headers-3.1.0-1.fc20.noarch How reproducible: 100% Steps to Reproduce: 1. $ cat a.c #ifdef __linux__ #include <netinet/in.h> #else #include <ws2tcpip.h> #endif int foo(void) { struct in6_addr a = IN6ADDR_ANY_INIT; struct in6_addr b = IN6ADDR_LOOPBACK_INIT; return IN6_IS_ADDR_UNSPECIFIED(&a) + IN6_IS_ADDR_LOOPBACK(&b); } 2. $ gcc -c -o a.o -Wall -Wmissing-braces a.c 3. $ i686-w64-mingw32-gcc -c -o a.o -Wall -Wmissing-braces a.c Actual results: 2 is silent, 3 spews: a.c: In function 'foo': a.c:7:10: warning: missing braces around initializer [-Wmissing-braces] struct in6_addr a = IN6ADDR_ANY_INIT; ^ a.c:7:10: warning: (near initialization for 'a.u') [-Wmissing-braces] a.c:8:10: warning: missing braces around initializer [-Wmissing-braces] struct in6_addr b = IN6ADDR_LOOPBACK_INIT; ^ a.c:8:10: warning: (near initialization for 'b.u') [-Wmissing-braces] Expected results: Just as glibc's definition is silent, mingw should add enough {} to allow silent compilation. Additional info: Libvirt has had to workaround the problem by using initialization by struct copy, rather than the standardized IP6ADDR_ANY_INIT, because it compiles with -Werror -Wmissing-braces: http://libvirt.org/git/?p=libvirt.git;a=commitdiff;h=057d26b2ac05dc3d2
@Kai Tietz: Could you take a look at this? This sounds like material which should be resolved in upstream mingw-w64
I managed to get this issue fixed upstream: https://sourceforge.net/p/mingw-w64/mingw-w64/ci/b8e8160da0648fc0406b028a2bff0938d9b9175e/ The latest mingw-headers in rawhide and EPEL7 contains this fix (mingw-headers-3.1.999-0.10.trunk.gitb8e816.20140530.fc21). Do you want the fix to be backported to other Fedora branches as well?
(In reply to Erik van Pienbroek from comment #2) > Do you want the fix to be backported to other Fedora branches as well? At this point, libvirt has already installed a workaround and does mingw cross builds just fine on current F20 headers, so there's no urgent need for a backport. Up to you if you want to just leave the bug present in older releases and require people to upgrade to benefit from the newer header.
Okay, then I'll leave the f19 and f20 branches 'as is' for now as there are no known other mingw packages which fail to build because of this bug.