c-typeck.c (pop_init_level): Improve diagnostics.

2012-04-25  Manuel López-Ibáñez  <manu@gcc.gnu.org>

	* c-typeck.c (pop_init_level): Improve diagnostics.
testsuite/
	* gcc.dg/m-un-2.c: Update.
	* gcc.dg/20011021-1.c: Update.

From-SVN: r186807
parent f1fb11f1
2012-04-25 Manuel López-Ibáñez <manu@gcc.gnu.org>
* c-typeck.c (pop_init_level): Improve diagnostics.
2012-04-25 Uros Bizjak <ubizjak@gmail.com> 2012-04-25 Uros Bizjak <ubizjak@gmail.com>
* compare-elim.c (try_eliminate_compare): Also handle operands with * compare-elim.c (try_eliminate_compare): Also handle operands with
......
...@@ -7060,10 +7060,12 @@ pop_init_level (int implicit, struct obstack * braced_init_obstack) ...@@ -7060,10 +7060,12 @@ pop_init_level (int implicit, struct obstack * braced_init_obstack)
/* Do not warn about initializing with ` = {0}'. */ /* Do not warn about initializing with ` = {0}'. */
&& !constructor_zeroinit) && !constructor_zeroinit)
{ {
push_member_name (constructor_unfilled_fields); if (warning_at (input_location, OPT_Wmissing_field_initializers,
warning_init (OPT_Wmissing_field_initializers, "missing initializer for field %qD of %qT",
"missing initializer"); constructor_unfilled_fields,
RESTORE_SPELLING_DEPTH (constructor_depth); constructor_type))
inform (DECL_SOURCE_LOCATION (constructor_unfilled_fields),
"%qT declared here", constructor_unfilled_fields);
} }
} }
......
2012-04-25 Manuel López-Ibáñez <manu@gcc.gnu.org>
* gcc.dg/m-un-2.c: Update.
* gcc.dg/20011021-1.c: Update.
2012-04-25 Tobias Burnus <burnus@net-b.de> 2012-04-25 Tobias Burnus <burnus@net-b.de>
PR fortran/52196 PR fortran/52196
......
...@@ -42,4 +42,4 @@ struct multilevel M = ...@@ -42,4 +42,4 @@ struct multilevel M =
{ .n = 9 }, /* { dg-bogus "initialization of union" } */ { .n = 9 }, /* { dg-bogus "initialization of union" } */
/* "string here" */ /* "string here" */
}; /* { dg-warning "missing init" } */ }; /* { dg-warning "missing init" } */
/* { dg-warning "near init" "near init" { target *-*-* } 44 } */ /* { dg-message "declared here" "near init" { target *-*-* } 27 } */
...@@ -16,7 +16,7 @@ struct vtable mtable = { ...@@ -16,7 +16,7 @@ struct vtable mtable = {
malloc, malloc,
free free
}; /* { dg-warning "missing initializer" "warning regression" { target *-*-* } {18} } */ }; /* { dg-warning "missing initializer" "warning regression" { target *-*-* } {18} } */
/* { dg-warning "initialization for 'mtable._realloc'" "warning regression 2" { target *-*-* } {18} } */ /* { dg-message "declared here" "warning regression 2" { target *-*-* } {12} } */
/* With designated initializers, we assume you meant to leave out the /* With designated initializers, we assume you meant to leave out the
initialization of any blank fields. */ initialization of any blank fields. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment