From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7505 invoked by alias); 1 Dec 2015 17:54:32 -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 7489 invoked by uid 89); 1 Dec 2015 17:54:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 X-HELO: usplmg21.ericsson.net Received: from usplmg21.ericsson.net (HELO usplmg21.ericsson.net) (198.24.6.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Tue, 01 Dec 2015 17:54:30 +0000 Received: from EUSAAHC007.ericsson.se (Unknown_Domain [147.117.188.93]) by usplmg21.ericsson.net (Symantec Mail Security) with SMTP id 38.0B.32102.1DEDD565; Tue, 1 Dec 2015 18:54:25 +0100 (CET) Received: from [142.133.110.144] (147.117.188.8) by smtp-am.internal.ericsson.com (147.117.188.95) with Microsoft SMTP Server id 14.3.248.2; Tue, 1 Dec 2015 12:54:27 -0500 Subject: Re: [commit] Fix build error (Re: [PATCH v2 2/3] Display names of remote threads) To: Ulrich Weigand References: <20151201170837.DC954F8BD@oc7340732750.ibm.com> CC: Pedro Alves , From: Simon Marchi Message-ID: <565DDED2.9000806@ericsson.com> Date: Tue, 01 Dec 2015 17:54:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151201170837.DC954F8BD@oc7340732750.ibm.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-12/txt/msg00020.txt.bz2 On 15-12-01 12:08 PM, Ulrich Weigand wrote: > Simon Marchi wrote: >=20 >> (thread_item_t) : New field. >=20 > This causes build errors for me when using a GCC 4.4.7 host compiler: >=20 > gdb/remote.c: In function =E2?~remote_update_thread_list=E2?T: > gdb/remote.c:2855: error: =E2?~item.name=E2?T may be used uninitialized i= n this function > gdb/remote.c:3079: note: =E2?~item.name=E2?T was declared here >=20 > There were in fact two places where a struct thread_item with an uninitia= lized > name field was added to a vector. >=20 > I've checked in the following patch to fix the build error. >=20 > Bye, > Ulrich >=20 > ChangeLog: >=20 > * remote.c (remote_newthread_step): Initialize item.name. > (remote_get_threads_with_qthreadinfo): Likewise. >=20 > diff --git a/gdb/remote.c b/gdb/remote.c > index 9d44ce1..c60f173 100644 > --- a/gdb/remote.c > +++ b/gdb/remote.c > @@ -2914,6 +2914,7 @@ remote_newthread_step (threadref *ref, void *data) >=20=20 > item.ptid =3D ptid_build (pid, threadref_to_int (ref), 0); > item.core =3D -1; > + item.name =3D NULL; > item.extra =3D NULL; >=20=20 > VEC_safe_push (thread_item_t, context->items, &item); > @@ -3079,6 +3080,7 @@ remote_get_threads_with_qthreadinfo (struct target_= ops *ops, >=20=20 > item.ptid =3D read_ptid (bufp, &bufp); > item.core =3D -1; > + item.name =3D NULL; > item.extra =3D NULL; >=20=20 > VEC_safe_push (thread_item_t, context->items, &item); >=20 Thanks!