From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30183 invoked by alias); 16 Mar 2012 01:56:32 -0000 Received: (qmail 30175 invoked by uid 22791); 16 Mar 2012 01:56:31 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-iy0-f169.google.com (HELO mail-iy0-f169.google.com) (209.85.210.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 16 Mar 2012 01:56:16 +0000 Received: by iajr24 with SMTP id r24so5560955iaj.0 for ; Thu, 15 Mar 2012 18:56:16 -0700 (PDT) Received: by 10.50.155.229 with SMTP id vz5mr11864991igb.12.1331862976347; Thu, 15 Mar 2012 18:56:16 -0700 (PDT) Received: from [192.168.1.100] ([125.118.51.116]) by mx.google.com with ESMTPS id gh8sm2659569igb.16.2012.03.15.18.56.13 (version=SSLv3 cipher=OTHER); Thu, 15 Mar 2012 18:56:15 -0700 (PDT) Message-ID: <4F629DE1.8060002@gmail.com> Date: Fri, 16 Mar 2012 01:56:00 -0000 From: asmwarrior User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:11.0) Gecko/20120312 Thunderbird/11.0 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: [msys+mingw] build error [-Werror=uninitialized] Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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/msg00585.txt.bz2 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 So, I think it can be quickly fixed by using: CORE_ADDR addr = 0; 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. Yuanhui Zhang