On Wed, 14 Mar 2007, der Mouse wrote:
> I'm going to add -W{no-,}missing-init, for fine-grained
control over
> incomplete initializer warnings. In particular, I
don't want those
> warnings, but I do want the rest of the stuff -W gets
me
That sounds useful.
I'd actually like to get warnings about missing braces and
missing
initialisers in most cases, but not in the case where a
struct is
initialised by . For example, I want a warning about
missing braces
if I do
struct s {int i;};
struct s array[2] = {1, 2}; /* should be {, } */
and I want a warning about incomplete initialisers for
this:
struct t {int i, j;};
struct t array[2] = {, }; /* should be {{1, 0}, {2,
0}} */
but I don't want any warning at all if I do
struct opaque foo = ;
struct opaque array[2] = {, };
NetBSD's code is riddled with struct assignments that use
structvar = {.somefield = 0};
to get the effects that should be available from
structvar = ;
I consider the version with to be better style, the C99
standard
specifies the same meaning for both, but the version with
triggers
from warnings from gcc.
--apb (Alan Barrett)
|