On 2/16/12, Diego Novillo <dnovi...@google.com> wrote: > With this patch, I'm getting: > > gcc/cp/pph-in.c: In function 'tree_node* pph_in_tree(pph_stream*)': > gcc/cp/pph-in.c:1694:70: error: 'decl_declared_inline' may be used > uninitialized in this function > [-Werror=maybe-uninitialized]gcc/cp/pph-in.c:1644:8: note: > 'decl_declared_inline' was declared here > gcc/cp/pph-in.c:1683:75: error: 'decl_comdat_group' may be used > uninitialized in this function > [-Werror=maybe-uninitialized]gcc/cp/pph-in.c:1643:8: note: > 'decl_comdat_group' was declared here > gcc/cp/pph-in.c:1682:50: error: 'decl_comdat' may be used > uninitialized in this function > [-Werror=maybe-uninitialized]gcc/cp/pph-in.c:1642:8: note: > 'decl_comdat' was declared here > cc1plus: all warnings being treated as errors > make: *** [cp/pph-in.o] Error 1 > > Could you take a look?
This patch avoids a false "used unititalized" error by assigning values soon to be overwritten. Tested on x64. Index: gcc/cp/ChangeLog.pph 2012-02-16 Lawrence Crowl <cr...@google.com> * pph-in.c (pph_in_merge_lang_indep_tree_body): Avoid a false "used uninitialized" error message. Index: gcc/cp/pph-in.c =================================================================== --- gcc/cp/pph-in.c (revision 184290) +++ gcc/cp/pph-in.c (working copy) @@ -1639,10 +1639,10 @@ static void pph_in_merge_lang_indep_tree_body (pph_stream *stream, tree expr) { enum tree_code code = TREE_CODE (expr); - bool decl_comdat; - tree decl_comdat_group; - bool decl_declared_inline; - tree decl_result; + bool decl_comdat = false; + tree decl_comdat_group = NULL; + bool decl_declared_inline = false; + tree decl_result = NULL; if (CODE_CONTAINS_STRUCT (code, TS_DECL_WITH_VIS)) { -- Lawrence Crowl