]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
doc: Clarification for -Wmissing-field-initializers
authorMarek Polacek <polacek@redhat.com>
Thu, 8 Jun 2023 17:52:11 +0000 (13:52 -0400)
committerMarek Polacek <polacek@redhat.com>
Fri, 9 Jun 2023 14:22:42 +0000 (10:22 -0400)
The manual is incorrect in saying that the option does not warn
about designated initializers, which it does in C++.  Whether the
divergence in behavior is desirable is another thing, but let's
at least make the manual match the reality.

PR c/39589
PR c++/96868

gcc/ChangeLog:

* doc/invoke.texi: Clarify that -Wmissing-field-initializers doesn't
warn about designated initializers in C only.

gcc/doc/invoke.texi

index 6d08229ce403620ba8d1e3f63d770b0e69b4d5e7..0870f7aff93616b0f92ab4097133e9419f3fd5f9 100644 (file)
@@ -9591,8 +9591,9 @@ struct s @{ int f, g, h; @};
 struct s x = @{ 3, 4 @};
 @end smallexample
 
-This option does not warn about designated initializers, so the following
-modification does not trigger a warning:
+@c It's unclear if this behavior is desirable.  See PR39589 and PR96868.
+In C this option does not warn about designated initializers, so the
+following modification does not trigger a warning:
 
 @smallexample
 struct s @{ int f, g, h; @};