This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] struct member warning
- To: law at cygnus dot com
- Subject: Re: [patch] struct member warning
- From: Bruno Haible <haible at ilog dot fr>
- Date: Mon, 29 Jun 1998 11:28:39 +0200 (MET DST)
- Cc: egcs-patches at cygnus dot com
- References: <199803301357.PAA17885@halles.ilog.fr><14435.898320419@hurl.cygnus.com>
Jeffrey A. Law writes:
> I made some minor comment clarifications and installed this patch.
Thanks. Additionally, here is a documentation patch for it.
*** egcs-19980621/gcc/invoke.texi.bak Sun Jun 28 22:10:19 1998
--- egcs-19980621/gcc/invoke.texi Sun Jun 28 22:13:57 1998
***************
*** 1531,1536 ****
--- 1531,1546 ----
struct t @{ struct s h; int i; @};
struct t x = @{ 1, 2, 3 @};
@end smallexample
+
+ @item
+ An aggregate has an initializer which does not initialize all members.
+ For example, the following code would cause such a warning, because
+ @code{x.h} would be implicitly initialized to zero:
+
+ @smallexample
+ struct s @{ int f, g, h; @};
+ struct s x = @{ 3, 4 @};
+ @end smallexample
@end itemize
@item -Wtraditional