From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13496 invoked by alias); 16 Mar 2012 08:19:47 -0000 Received: (qmail 13412 invoked by uid 22791); 16 Mar 2012 08:19:44 -0000 X-SWARE-Spam-Status: No, hits=-6.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_SM,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 16 Mar 2012 08:19:30 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q2G8JQrx030821 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 16 Mar 2012 04:19:26 -0400 Received: from host2.jankratochvil.net (ovpn-116-16.ams2.redhat.com [10.36.116.16]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q2G8JLIL002800 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 16 Mar 2012 04:19:24 -0400 Date: Fri, 16 Mar 2012 08:19:00 -0000 From: Jan Kratochvil To: Yao Qi Cc: asmwarrior , gdb-patches@sourceware.org Subject: [commit] [msys+mingw] build error [-Werror=uninitialized] Message-ID: <20120316081921.GB17525@host2.jankratochvil.net> References: <4F629DE1.8060002@gmail.com> <4F62EAC8.8020000@codesourcery.com> <4F62EC5C.1050609@gmail.com> <4F62EF65.1030203@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F62EF65.1030203@codesourcery.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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/msg00590.txt.bz2 On Fri, 16 Mar 2012 08:44:37 +0100, Yao Qi wrote: > On 03/16/2012 03:31 PM, asmwarrior wrote: > > TRY_CATCH (ex, RETURN_MASK_ERROR) > > { > > addr = value_as_address (vfn); > > } > > Which means addr is set before passed to print_function_pointer_address() call. > > > > So I'm not sure why gcc report such warning. > > No idea on this. Patch below fixes the problem on my box. Added there a comment like in other cases. This improper warning happens with TRY_CATCH on older gccs. Thanks, Jan http://sourceware.org/ml/gdb-cvs/2012-03/msg00203.html --- src/gdb/ChangeLog 2012/03/15 18:53:42 1.14016 +++ src/gdb/ChangeLog 2012/03/16 08:18:07 1.14017 @@ -1,3 +1,9 @@ +2012-03-16 Yao Qi + Jan Kratochvil + + Fix false compilation warning. + * gnu-v3-abi.c (print_one_vtable): Initialize ADDR. + 2012-03-15 Jonathan Larmour Pedro Alves --- src/gdb/gnu-v3-abi.c 2012/03/15 15:43:11 1.70 +++ src/gdb/gnu-v3-abi.c 2012/03/16 08:18:09 1.71 @@ -869,8 +869,9 @@ for (i = 0; i <= max_voffset; ++i) { + /* Initialize it just to avoid a GCC false warning. */ + CORE_ADDR addr = 0; struct value *vfn; - CORE_ADDR addr; volatile struct gdb_exception ex; printf_filtered ("[%d]: ", i);