This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/18370] New: cp_parser_initializer_list uninit variable problems
- From: "dcb314 at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Nov 2004 08:38:23 -0000
- Subject: [Bug c++/18370] New: cp_parser_initializer_list uninit variable problems
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
I just tried to compile this code on a i686 Linux box with valgrind 2.2
int p1[ 10 ] =
{
0, 0, 0, 0, 2, 0, 2, 0, 2, 3,
};
The compiler said
[dcb@localhost src]$ ~/valgrind/results.220/bin/valgrind --tool=memcheck
--trace-children=yes -q ~/gnu/gcc343/results/bin/g++ -Wno-deprecated -c
gcc343bug.cc
==30646== Conditional jump or move depends on uninitialised value(s)
==30646== at 0x80E6AF0: cp_parser_initializer_list (parser.c:11646)
==30646== by 0x80E69A1: cp_parser_initializer_clause (parser.c:11581)
==30646== by 0x80F058B: cp_parser_init_declarator (parser.c:11486)
==30646== by 0x80EAC01: cp_parser_simple_declaration (parser.c:6524)
[dcb@localhost src]$
The compiler source code is
initializer = cp_parser_initializer_clause (parser,
&clause_non_constant_p);
if (clause_non_constant_p)
Suggest that variable clause_non_constant_p hasn't been initialised
by routine cp_parser_initializer_clause.
--
Summary: cp_parser_initializer_list uninit variable problems
Product: gcc
Version: 3.4.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dcb314 at hotmail dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: i686-linux-pc-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18370