This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: strange 'warning: missing initializer'


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 Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]