From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 124547 invoked by alias); 1 Dec 2015 16:06:39 -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 124524 invoked by uid 89); 1 Dec 2015 16:06:39 -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_HELO_PASS,T_RP_MATCHES_RCVD 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; Tue, 01 Dec 2015 16:06:34 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id 538343B757; Tue, 1 Dec 2015 16:06:33 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tB1G6V6G022881; Tue, 1 Dec 2015 11:06:32 -0500 Message-ID: <565DC587.7060005@redhat.com> Date: Tue, 01 Dec 2015 16:06:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Ulrich Weigand CC: gdb-patches@sourceware.org Subject: Re: [PATCH 10/18] Remote thread create/exit events References: <20151201151227.7FB35F8BD@oc7340732750.ibm.com> In-Reply-To: <20151201151227.7FB35F8BD@oc7340732750.ibm.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-12/txt/msg00015.txt.bz2 On 12/01/2015 03:12 PM, Ulrich Weigand wrote: > Pedro Alves wrote: > >> + case 'w': /* Thread exited. */ >> + { >> + char *p; >> + ULONGEST value; >> + >> + event->ws.kind = TARGET_WAITKIND_THREAD_EXITED; >> + p = unpack_varlen_hex (&buf[1], &value); >> + event->ws.value.integer = value; >> + if (*p != ';') >> + error (_("stop reply packet badly formatted: %s"), buf); >> + event->ptid = read_ptid (++p, &p); > > This causes a build error on my RHEL 5 daily build system (using > the GCC 4.1.2 host compiler) due to: > > gdb/remote.c: In function 'remote_parse_stop_reply': > gdb/remote.c:6549: warning: operation on 'p' may be undefined > > I'm not 100% convinced this is really undefined, since the > value of &p doesn't change whether or not ++p is evaluated > before or after it. I agree. > > But in any case, since p isn't used afterwards, any reason why > this couldn't instead just be: > > event->ptid = read_ptid (++p, NULL); Indeed, that should work. Thanks, Pedro Alves