This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb] Avoid "operation may be undefined" warning in remote.c
- From: Ulrich Weigand <uweigand at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 1 Dec 2015 17:07:02 -0000
- Subject: [binutils-gdb] Avoid "operation may be undefined" warning in remote.c
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=974eac9d7694ca14dcdf6d1a74777a265fffdb95
commit 974eac9d7694ca14dcdf6d1a74777a265fffdb95
Author: Ulrich Weigand <ulrich.weigand@de.ibm.com>
Date: Tue Dec 1 18:04:39 2015 +0100
Avoid "operation may be undefined" warning in remote.c
GCC 4.1 gives the following warning:
gdb/remote.c: In function 'remote_parse_stop_reply':
gdb/remote.c:6549: warning: operation on 'p' may be undefined
on this line of code:
event->ptid = read_ptid (++p, &p);
Since p actually isn't used afterwards anyway, simply use NULL.
gdb/
* remote.c (remote_parse_stop_reply): Avoid GCC 4.1 "operation
may be undefined" warning.
Diff:
---
gdb/ChangeLog | 5 +++++
gdb/remote.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 49ba2bc..2f87091 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2015-12-01 Ulrich Weigand <uweigand@de.ibm.com>
+ * remote.c (remote_parse_stop_reply): Avoid GCC 4.1 "operation
+ may be undefined" warning.
+
+2015-12-01 Ulrich Weigand <uweigand@de.ibm.com>
+
* remote.c (remote_newthread_step): Initialize item.name.
(remote_get_threads_with_qthreadinfo): Likewise.
diff --git a/gdb/remote.c b/gdb/remote.c
index c60f173..52c5df8 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -6548,7 +6548,7 @@ Packet: '%s'\n"),
event->ws.value.integer = value;
if (*p != ';')
error (_("stop reply packet badly formatted: %s"), buf);
- event->ptid = read_ptid (++p, &p);
+ event->ptid = read_ptid (++p, NULL);
break;
}
case 'W': /* Target exited. */