Paul Eggert wrote:
> It causes "gcc -Wall" to issue a warning, but you can work around
> this by appending -Wno-missing-braces.
The warning that this kind of initializer (with or without the trailing
comma) elicits with "gcc -W -Wall" on glibc systems is
foo.c:3: warning: missing initializer
foo.c:3: warning: (near initialization for 'm.__value')
To turn off this warning one needs to pass -Wno-missing-field-initializers.
But I don't think it's a good advice to tell people to use
-Wno-missing-field-initializers. This warning was introduced because it
can catch real, nasty programming errors (namely, when you have vtable-
like structs, like in the Linux kernel, and you add one element at the
end of the struct but forget to update some of the implementations).
Similarly, -Wno-missing-braces is also a useful one, because it catches
initializer bugs with nested structs and unions. It helped me more than one
in GNU clisp.
Globally I think it's a bad tradeoff to sacrifice a gcc warning for the
sake of 7 lines of code.
Bruno