From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 49399 invoked by alias); 1 Dec 2015 17:38:09 -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 49381 invoked by uid 89); 1 Dec 2015 17:38:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mailapp01.imgtec.com Received: from mailapp01.imgtec.com (HELO mailapp01.imgtec.com) (195.59.15.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 01 Dec 2015 17:38:07 +0000 Received: from hhmail02.hh.imgtec.org (unknown [10.100.10.20]) by Websense Email Security Gateway with ESMTPS id EBEF56DF68E17 for ; Tue, 1 Dec 2015 17:38:01 +0000 (GMT) Received: from BAMAIL02.ba.imgtec.org (10.20.40.28) by hhmail02.hh.imgtec.org (10.100.10.20) with Microsoft SMTP Server (TLS) id 14.3.235.1; Tue, 1 Dec 2015 17:38:04 +0000 Received: from ubuntu-sellcey.mips.com (10.20.3.214) by bamail02.ba.imgtec.org (10.20.40.28) with Microsoft SMTP Server id 14.3.174.1; Tue, 1 Dec 2015 09:38:01 -0800 Received: by ubuntu-sellcey.mips.com (sSMTP sendmail emulation); Tue, 01 Dec 2015 09:38:01 -0800 From: "Steve Ellcey " Date: Tue, 01 Dec 2015 17:38:00 -0000 To: Subject: [Patch] Fix GDB build when using GCC 4.1.2 User-Agent: Heirloom mailx 12.5 6/20/10 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-ID: <0adf15e3-d761-4de7-9ac7-ba3e3f283942@BAMAIL02.ba.imgtec.org> X-SW-Source: 2015-12/txt/msg00019.txt.bz2 A recent gdb change has broken my ability to build gdb with GCC 4.1.2. It dies with: /scratch/sellcey/repos/gdb/src/gdb/gdb/remote.c: In function 'remote_newthread_step': /scratch/sellcey/repos/gdb/src/gdb/gdb/remote.c:2844: warning: 'item.name' is used uninitialized in this function make[1]: *** [remote.o] Error 1 I am not seeing this error with newer GCC versions that I build with so it may be a GCC bug but I would like to change gdb so I can still build with GCC 4.1.2. The fix is to simply initialize item.name in the locations where item.extra is already being initialized. This allows me to build gdb. OK to checkin? Steve Ellcey sellcey@imgtec.com 2015-12-01 Steve Ellcey * remote.c (remote_newthread_step): Initialize item.name. (remote_get_threads_with_qthreadinfo): Ditto. diff --git a/gdb/remote.c b/gdb/remote.c index 90be8b6..753241a 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -2904,6 +2904,7 @@ remote_newthread_step (threadref *ref, void *data) item.ptid = ptid_build (pid, threadref_to_int (ref), 0); item.core = -1; item.extra = NULL; + item.name = NULL; VEC_safe_push (thread_item_t, context->items, &item); @@ -3069,6 +3070,7 @@ remote_get_threads_with_qthreadinfo (struct target_ops *ops, item.ptid = read_ptid (bufp, &bufp); item.core = -1; item.extra = NULL; + item.name = NULL; VEC_safe_push (thread_item_t, context->items, &item); }