I\'m using GCC 4.6.2 (Mingw) and compiling with -Wextra
. I\'m getting strange warnings whenever I use designated initializers. For the following code
It seems that the warning is, as you say, "too blunt".
This pattern of access, initializing each member struct as a whole, satisfies the compiler:
bug_struct bug_struct1 =
{
.s1 = {.x = 1, .y = 2},
.s2[0] = {.x = 1, .y = 2},
.s2[1] = {.x = 1, .y = 2},
.s2[2] = {.x = 1, .y = 2},
.s2[3] = {.x = 1, .y = 2}
};