From patchwork Wed Feb 4 17:34:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alex Velenko X-Patchwork-Id: 4913 Received: (qmail 21346 invoked by alias); 4 Feb 2015 17:34:48 -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 21326 invoked by uid 89); 4 Feb 2015 17:34:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: service87.mimecast.com Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 04 Feb 2015 17:34:46 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by service87.mimecast.com; Wed, 04 Feb 2015 17:34:44 +0000 Received: from [10.2.207.44] ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 4 Feb 2015 17:34:42 +0000 Message-ID: <54D25832.1010007@arm.com> Date: Wed, 04 Feb 2015 17:34:42 +0000 From: Alex Velenko User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Patrick Palka , Pedro Alves CC: "gdb-patches@sourceware.org" Subject: Re: Re: [PATCH 3/3] Simplify event-loop core, remove two-step event processing References: <1422292759-22307-1-git-send-email-palves@redhat.com> <1422292759-22307-4-git-send-email-palves@redhat.com> In-Reply-To: X-MC-Unique: 115020417344404801 X-IsSubscribed: yes On 03/02/15 22:48, Patrick Palka wrote: > This patch causes a build failure when compiling GDB with GCC 4.9: > > /home/patrick/code/binutils-gdb/gdb/event-loop.c: In function > ‘gdb_do_one_event’: > /home/patrick/code/binutils-gdb/gdb/event-loop.c:296:10: error: ‘res’ > may be used uninitialized in this function > [-Werror=maybe-uninitialized] > if (res > 0) > ^ > Hi, Event-loop.c "gdb_do_one_event" function did not initialize variable "res". This caused gdb_binutils to fail building. This patch fixes it. Builds with this patch, does not build without it. Is patch ok? If ok, could you, please, commit (I can't)? Kind regards, Alex gdb/ 2015-02-04 Alex Velenko * event-loop.c (gdb_do_one_event): variable "res" initialized. --- gdb/event-loop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/event-loop.c b/gdb/event-loop.c index 7425b3a..1e2dc45 100644 --- a/gdb/event-loop.c +++ b/gdb/event-loop.c @@ -270,7 +270,7 @@ gdb_do_one_event (void) round-robin fashion. */ for (current = 0; current < number_of_sources; current++) { - int res; + int res = 0; switch (event_source_head) {