This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] doc: mention handling of {0} in -Wmissing-field-initializers (PR 71250)
- From: Alexander Monakov <amonakov at ispras dot ru>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 19 Apr 2017 16:12:40 +0300 (MSK)
- Subject: [PATCH] doc: mention handling of {0} in -Wmissing-field-initializers (PR 71250)
- Authentication-results: sourceware.org; auth=none
Hi,
PR 71250 asks to explicitly document that -Wmissing-field-initializers warning
was enhanced some time ago to suppress warnings on uses of the universal zero
initializer { 0 } in C language. The documentation already calls out that the
warning is silenced in C++ for '{ }', the patch adds the corresponding C example
just before that.
Sanity-checked with 'make info html', ok to apply?
Alexander
PR other/71250
* doc/invoke.texi (-Wmissing-field-initializers): Mention that warning
is suppressed for '{ 0 }' in C.
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 8d3821e..726d4c1 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -6220,7 +6220,15 @@ struct s @{ int f, g, h; @};
struct s x = @{ .f = 3, .g = 4 @};
@end smallexample
-In C++ this option does not warn either about the empty @{ @}
+In C this option does not warn about the universal zero initializer
+@samp{@{ 0 @}}:
+
+@smallexample
+struct s @{ int f, g, h; @};
+struct s x = @{ 0 @};
+@end smallexample
+
+Likewise, in C++ this option does not warn about the empty @{ @}
initializer, for example:
@smallexample