From 7041308f607f80a2d5c00d01e7e7c907722f86e7 Mon Sep 17 00:00:00 2001 From: Alexander Monakov Date: Thu, 20 Apr 2017 13:23:38 +0300 Subject: [PATCH] doc: mention handling of {0} in -Wmissing-field-initializers (PR 71250) PR other/71250 * doc/invoke.texi (-Wmissing-field-initializers): Mention that warning is suppressed for '{ 0 }' in C. From-SVN: r247018 --- gcc/ChangeLog | 6 ++++++ gcc/doc/invoke.texi | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5ded09b27fd..c908048f21b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-04-20 Alexander Monakov + + PR other/71250 + * doc/invoke.texi (-Wmissing-field-initializers): Mention that warning + is suppressed for '{ 0 }' in C. + 2017-04-20 Jakub Jelinek * BASE-VER: Set to 8.0.0. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 19a85b6cd9a..5ee13b8984a 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 -- 2.30.2