This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 10/18] Remote thread create/exit events
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: palves at redhat dot com (Pedro Alves)
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 1 Dec 2015 16:12:27 +0100 (CET)
- Subject: Re: [PATCH 10/18] Remote thread create/exit events
- Authentication-results: sourceware.org; auth=none
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.
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);
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com