From patchwork Wed Aug 20 10:32:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 2451 Received: (qmail 28060 invoked by alias); 20 Aug 2014 10:32:32 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 28045 invoked by uid 89); 20 Aug 2014 10:32:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 20 Aug 2014 10:32:31 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s7KAWSPQ006114 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Aug 2014 06:32:28 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s7KAWQfg004679; Wed, 20 Aug 2014 06:32:27 -0400 Message-ID: <53F4793A.6080205@redhat.com> Date: Wed, 20 Aug 2014 11:32:26 +0100 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Andrew Pinski CC: Jan Kratochvil , "gdb-patches@sourceware.org" Subject: [PUSHED] value.c (value_contents_bits_eq): Initialize l, h for gcc, -Wall. (was: Re: [PATCH v2] Handle partially optimized out values similarly to unavailable values) References: <20140709103312.GA27884@host2.jankratochvil.net> <53BD2CE0.1000308@redhat.com> <20140709153121.GA7989@host2.jankratochvil.net> <53C41D5D.9030109@redhat.com> <20140716215838.GA29855@host2.jankratochvil.net> <53D0F72D.9010701@redhat.com> <20140815201332.GA2806@host2.jankratochvil.net> <53F3DF83.3020006@redhat.com> <53F46E74.5060107@redhat.com> In-Reply-To: <53F46E74.5060107@redhat.com> On 08/20/2014 10:46 AM, Pedro Alves wrote: > On 08/20/2014 01:54 AM, Andrew Pinski wrote: >> On Tue, Aug 19, 2014 at 4:36 PM, Pedro Alves wrote: > > >>> Great, I pushed this in then. >> >> This caused a build error for me: >> >> cc1: warnings being treated as errors >> ../../gdb/value.c: In function ‘value_contents_eq’: >> ../../gdb/value.c:830: error: ‘l’ may be used uninitialized in this function >> ../../gdb/value.c:830: note: ‘l’ was declared here >> ../../gdb/value.c:830: error: ‘h’ may be used uninitialized in this function >> ../../gdb/value.c:830: note: ‘h’ was declared here >> make[2]: *** [value.o] Error 1 >> >> Thanks, >> Andrew Pinski > > Thanks Andrew. I'm looking. > I can't trigger that, but should be fixed now. Thanks. ------------ value.c (value_contents_bits_eq): Initialize l,h for gcc -Wall. gdb/ * value.c (value_contents_bits_eq): Initialize l,h for gcc -Wall. --- gdb/ChangeLog | 4 ++++ gdb/value.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 55cc92c..c0b4f82 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2014-08-20 Pedro Alves + + * value.c (value_contents_bits_eq): Initialize l,h for gcc -Wall. + 2014-08-20 Yao Qi * amd64-tdep.c (amd64_classify): Add a blank line after the diff --git a/gdb/value.c b/gdb/value.c index b74f23a..09ee1ca 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -827,7 +827,7 @@ value_contents_bits_eq (const struct value *val1, int offset1, while (length > 0) { - ULONGEST l, h; + ULONGEST l = 0, h = 0; /* init for gcc -Wall */ int i; for (i = 0; i < 2; i++)