From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 67622 invoked by alias); 24 Feb 2016 21:06:35 -0000 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 Received: (qmail 67465 invoked by uid 89); 24 Feb 2016 21:06:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=HContent-Transfer-Encoding:8bit X-HELO: xyzzy.0x04.net Received: from xyzzy.0x04.net (HELO xyzzy.0x04.net) (109.74.193.254) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 24 Feb 2016 21:06:33 +0000 Received: from hogfather.0x04.net (89-65-66-135.dynamic.chello.pl [89.65.66.135]) by xyzzy.0x04.net (Postfix) with ESMTPS id 50F4D40000; Wed, 24 Feb 2016 22:07:25 +0100 (CET) Received: by hogfather.0x04.net (Postfix, from userid 1000) id DDA0C58010C; Wed, 24 Feb 2016 22:06:30 +0100 (CET) From: =?UTF-8?q?Marcin=20Ko=C5=9Bcielnicki?= To: sergiodj@redhat.com Cc: uweigand@de.ibm.com, cole945@gmail.com, gdb-patches@sourceware.org, =?UTF-8?q?Marcin=20Ko=C5=9Bcielnicki?= Subject: [PATCH] [OBV] gdb/rs6000: Fix maybe-uninitialized warning. Date: Wed, 24 Feb 2016 21:06:00 -0000 Message-Id: <1456347989-30766-1-git-send-email-koriakin@0x04.net> In-Reply-To: <87oab5zvlm.fsf@redhat.com> References: <87oab5zvlm.fsf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2016-02/txt/msg00759.txt.bz2 Introduced by 657f9cde9d531c9929bef9e02a8064101d568f50. gdb/ChangeLog: * rs6000-tdep.c (rs6000_frame_cache): Initialize frame and pc to 0 to avoid spurious warnings. --- Thanks for the report. I can't reproduce the problem locally, but this patch (pushed as obvious) should do the trick. gdb/ChangeLog | 5 +++++ gdb/rs6000-tdep.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ea9f3f4..95cabdb 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2016-02-24 Marcin Kościelnicki + + * rs6000-tdep.c (rs6000_frame_cache): Initialize frame and pc to 0 + to avoid spurious warnings. + 2016-02-24 Gary Benson * exec.c (exec_file_locate_attach): Do not attempt to diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index a56b8b6..d0c56d7 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -3209,7 +3209,7 @@ rs6000_frame_cache (struct frame_info *this_frame, void **this_cache) enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); struct rs6000_framedata fdata; int wordsize = tdep->wordsize; - CORE_ADDR func, pc; + CORE_ADDR func = 0, pc = 0; if ((*this_cache) != NULL) return (struct rs6000_frame_cache *) (*this_cache); -- 2.7.1