This is the mail archive of the gcc-bugs@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]

[Bug other/71250] New: -Wmissing-field-initializers documentation is incomplete


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71250

            Bug ID: 71250
           Summary: -Wmissing-field-initializers documentation is
                    incomplete
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vincent-gcc at vinc17 dot net
  Target Milestone: ---

When doing some tests on structure initialization and trying to reproduce a
warning, I was wondering why on

  struct { int a, b; } x = { 0 };

a warning was not emitted with -Wmissing-field-initializers, and the gcc-6 man
page did not help:

  -Wmissing-field-initializers
      Warn if a structure's initializer has some fields missing.  For
      example, the following code causes such a warning, because "x.h" is
      implicitly zero:

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

I eventually found bug 36750. So, the GCC documentation should be updated.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]