[patch] struct member warning

Bruno Haible haible@ilog.fr
Mon Jun 29 02:29:00 GMT 1998


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



More information about the Gcc-patches mailing list