From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2060 invoked by alias); 16 Mar 2012 07:26:21 -0000 Received: (qmail 2003 invoked by uid 22791); 16 Mar 2012 07:26:19 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,TW_SM X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 16 Mar 2012 07:26:05 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1S8RY3-0004VR-1r from Yao_Qi@mentor.com ; Fri, 16 Mar 2012 00:26:03 -0700 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Fri, 16 Mar 2012 00:26:00 -0700 Received: from [127.0.0.1] (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.1.289.1; Fri, 16 Mar 2012 00:26:01 -0700 Message-ID: <4F62EAC8.8020000@codesourcery.com> Date: Fri, 16 Mar 2012 07:26:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: asmwarrior CC: Subject: Re: [msys+mingw] build error [-Werror=uninitialized] References: <4F629DE1.8060002@gmail.com> In-Reply-To: <4F629DE1.8060002@gmail.com> Content-Type: text/plain; charset="UTF-8" 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: 2012-03/txt/msg00586.txt.bz2 On 03/16/2012 09:56 AM, asmwarrior wrote: > I see the build error in the latest cvs: > > mingw32-gcc -g -O2 -D__USE_MINGW_ACCESS -I. -I../../gdb/gdb > -I../../gdb/gdb/common -I../../gdb/gdb/config > -DLOCALEDIR="\"/mingw/share/locale\"" -DHAVE_CONFIG_H > -I../../gdb/gdb/../include/opcode -I../../gdb/gdb/../opcodes/.. > -I../../gdb/gdb/../readline/.. -I../bfd -I../../gdb/gdb/../bfd > -I../../gdb/gdb/../include -I../libdecnumber > -I../../gdb/gdb/../libdecnumber -I../../gdb/gdb/gnulib -Ignulib > -IE:/code/python272/include -IE:/code/python272/include -Wall > -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral > -Wno-pointer-sign -Wno-unused -Wunused-value -Wunused-function > -Wno-switch -Wno-char-subscripts -Wmissing-prototypes -Wno-format > -Werror -c -o gnu-v3-abi.o -MT gnu-v3-abi.o -MMD -MP -MF > .deps/gnu-v3-abi.Tpo ../../gdb/gdb/gnu-v3-abi.c > ../../gdb/gdb/gnu-v3-abi.c: In function 'print_one_vtable.isra.2': > ../../gdb/gdb/gnu-v3-abi.c:892:33: error: 'addr' may be used > uninitialized in this function [-Werror=uninitialized] > cc1.exe: all warnings being treated as errors > make[2]: *** [gnu-v3-abi.o] Error 1 I get the same error when building gdb on x86_64-linux. > > So, I think it can be quickly fixed by using: > CORE_ADDR addr = 0; > Yes, this fixes the build error I got. > Is this correct? I see the addr is used in the try catch block: > > TRY_CATCH (ex, RETURN_MASK_ERROR) > { > addr = value_as_address (vfn); > } > if (ex.reason < 0) > printf_filtered (_(""), ex.message); > else > print_function_pointer_address (gdbarch, addr, gdb_stdout, > opts->addressprint); > > Not sure why it still report such error. I didn't see any other errors. What error did you see even after you setting `addr' to 0? -- Yao (齐尧)