c-typeck.c (pop_init_level): Warn about implicit zero initialization of struct members.
* c-typeck.c (pop_init_level): Warn about implicit zero initialization of struct members. From-SVN: r20614
This commit is contained in:
parent
b152601696
commit
9dfcc8db5b
@ -1,3 +1,8 @@
|
||||
Fri Jun 19 23:22:42 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
|
||||
|
||||
* c-typeck.c (pop_init_level): Warn about implicit zero initialization
|
||||
of struct members.
|
||||
|
||||
Fri Jun 19 23:06:33 1998 Jason Merrill <jason@yorick.cygnus.com>
|
||||
|
||||
* varasm.c (assemble_start_function): Add weak_global_object_name.
|
||||
|
@ -5619,6 +5619,17 @@ pop_init_level (implicit)
|
||||
if (constructor_type != 0)
|
||||
size = int_size_in_bytes (constructor_type);
|
||||
|
||||
/* Warn when some struct elements are implicitly initialized to zero. */
|
||||
if (extra_warnings
|
||||
&& constructor_type
|
||||
&& TREE_CODE (constructor_type) == RECORD_TYPE
|
||||
&& constructor_unfilled_fields)
|
||||
{
|
||||
push_member_name (constructor_unfilled_fields);
|
||||
warning_init ("missing initializer%s", " for `%s'", NULL);
|
||||
RESTORE_SPELLING_DEPTH (constructor_depth);
|
||||
}
|
||||
|
||||
/* Now output all pending elements. */
|
||||
output_pending_init_elements (1);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user