Re: strange 'warning: missing initializer'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jiri,

As per the documentation,
http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

-Wmissing-field-initializers
Warn if a structure's initializer has some fields missing. For example, the
following code would cause such a warning, because x.h is implicitly zero:
  struct s { int f, g, h; };
  struct s x = { 3, 4 };

This option does not warn about designated initializers, so the following
modification would not trigger a warning:

  struct s { int f, g, h; };
  struct s x = { .f = 3, .g = 4 };

This warning is included in -Wextra. To get other -Wextra warnings without
this one, use '-Wextra -Wno-missing-field-initializers'.

HTH,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux