aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>1998-06-19 22:26:29 +0000
committerJeff Law <law@gcc.gnu.org>1998-06-19 16:26:29 -0600
commitb152601696e40c7fa65e1d07aaf16690c1ee6729 (patch)
tree45ed8cf764f5724ed73169a332e51f4e03fd6a5f
parentee8303096a7ad4bfdac14ed8ad8cfa437f2f5e30 (diff)
downloadgcc-b152601696e40c7fa65e1d07aaf16690c1ee6729.zip
gcc-b152601696e40c7fa65e1d07aaf16690c1ee6729.tar.gz
gcc-b152601696e40c7fa65e1d07aaf16690c1ee6729.tar.bz2
typeck2.c (pop_init_level): Warn about implicit zero initialization of struct members.
* typeck2.c (pop_init_level): Warn about implicit zero initialization of struct members. From-SVN: r20613
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/typeck2.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 863725a..2182e19 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+Fri Jun 19 23:22:42 1998 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
+
+ * typeck2.c (pop_init_level): Warn about implicit zero initialization
+ of struct members.
+
Thu Jun 18 09:32:32 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* cp-tree.h: Prototype function `check_java_method'.
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index e8974df..400c360 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -1105,6 +1105,11 @@ process_init_constructor (type, init, elts)
else if (TREE_CODE (TREE_TYPE (field)) == REFERENCE_TYPE)
error ("member `%s' is uninitialized reference",
IDENTIFIER_POINTER (DECL_NAME (field)));
+ /* Warn when some struct elements are implicitly initialized
+ to zero. */
+ else if (extra_warnings)
+ warning ("missing initializer for member `%s'",
+ IDENTIFIER_POINTER (DECL_NAME (field)));
}
}