From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14084 invoked by alias); 31 Mar 2011 15:41:23 -0000 Received: (qmail 14073 invoked by uid 22791); 31 Mar 2011 15:41:22 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SPF_SOFTFAIL,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e38.co.us.ibm.com (HELO e38.co.us.ibm.com) (32.97.110.159) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 31 Mar 2011 15:41:18 +0000 Received: from d03relay02.boulder.ibm.com (d03relay02.boulder.ibm.com [9.17.195.227]) by e38.co.us.ibm.com (8.14.4/8.13.1) with ESMTP id p2VFPnie012633 for ; Thu, 31 Mar 2011 09:25:49 -0600 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by d03relay02.boulder.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id p2VFfEXr053736 for ; Thu, 31 Mar 2011 09:41:15 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p2VFfExE009163 for ; Thu, 31 Mar 2011 09:41:14 -0600 Received: from [9.18.235.101] ([9.18.235.101]) by d03av02.boulder.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p2VFfC8x008831 for ; Thu, 31 Mar 2011 09:41:12 -0600 Subject: [commit] Fix unitialized warning in macroexp.c From: Thiago Jung Bauermann To: gdb-patches ml Content-Type: text/plain; charset="UTF-8" Date: Thu, 31 Mar 2011 16:19:00 -0000 Message-ID: <1301586070.9154.20.camel@hactar> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-03/txt/msg01219.txt.bz2 Hi, When compiling with -O3 (gcc 4.4.5), the build fails with: cc1: warnings being treated as errors /home/bauermann/trabalho/src/src/gdb/macroexp.c: In function ‘maybe_expand’: /home/bauermann/trabalho/src/src/gdb/macroexp.c:1186: error: ‘va_arg_name.len’ may be used uninitialized in this function /home/bauermann/trabalho/src/src/gdb/macroexp.c:1186: note: ‘va_arg_name.len’ was declared here /home/bauermann/trabalho/src/src/gdb/macroexp.c:1186: error: ‘va_arg_name.text’ may be used uninitialized in this function /home/bauermann/trabalho/src/src/gdb/macroexp.c:1186: note: ‘va_arg_name.text’ was declared here make: *** [macroexp.o] Error 1 I committed the following patch to fix the build. -- []'s Thiago Jung Bauermann IBM Linux Technology Center 2011-03-31 Thiago Jung Bauermann * macroexp.c (expand): Avoid uninitialized variable compiler warning. Index: macroexp.c =================================================================== RCS file: /cvs/src/src/gdb/macroexp.c,v retrieving revision 1.26 diff -u -r1.26 macroexp.c --- macroexp.c 9 Jan 2011 03:20:33 -0000 1.26 +++ macroexp.c 31 Mar 2011 15:39:41 -0000 @@ -1183,7 +1183,7 @@ struct macro_buffer *argv = NULL; struct macro_buffer substituted; struct macro_buffer substituted_src; - struct macro_buffer va_arg_name; + struct macro_buffer va_arg_name = {0}; int is_varargs = 0; if (def->argc >= 1)