Avoid "operation may be undefined" warning in remote.c
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Tue, 1 Dec 2015 17:04:39 +0000 (18:04 +0100)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Tue, 1 Dec 2015 17:04:39 +0000 (18:04 +0100)
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.

gdb/ChangeLog
gdb/remote.c

index 49ba2bc811252fa5160ec4bb51926e13eae243e1..2f870918d210c2a4ad77cc019eaf9750c894bb6c 100644 (file)
@@ -1,3 +1,8 @@
+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.
index c60f173632fa5a49e5ca2e3b6f655e90d0b6ac18..52c5df84c41d31dc030b645d1ad758c45dcc31dc 100644 (file)
@@ -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.  */