gdbserver/event-loop.c: type mismatch
authorPedro Alves <palves@redhat.com>
Fri, 10 Jul 2015 18:47:17 +0000 (19:47 +0100)
committerPedro Alves <palves@redhat.com>
Fri, 10 Jul 2015 18:47:17 +0000 (19:47 +0100)
Building with C++ catches a buglet here:

../../../src/gdb/gdbserver/event-loop.c:205:19: warning: invalid conversion from ‘gdb_client_data {aka void*}’ to ‘void**’ [-fpermissive]
   event_ptr->data = data;
                   ^

This works in practice because gdb_client_data is a pointer already
(hence in C we get an implicit conversion), and nothing deferences the
pointer.  It's passed from client at event registration/creation time,
only to pass straight back to client callback.

Well, that and nothing in gdbserver uses the event data anyway.

gdb/gdbserver/ChangeLog:
2015-07-10  Pedro Alves  <palves@redhat.com>

* event-loop.c (struct callback_event) <data>: Change type to
gdb_client_data instance instead of gdb_client_data pointer.
(append_callback_event): Adjust.

gdb/gdbserver/ChangeLog
gdb/gdbserver/event-loop.c

index 8ec0d8ea98c7929375d34b7392d5acd0dbd3f046..e87d7b9f95e7ba2a24bcf307031eb7f8b611a34f 100644 (file)
@@ -1,3 +1,9 @@
+2015-07-10  Pedro Alves  <palves@redhat.com>
+
+       * event-loop.c (struct callback_event) <data>: Change type to
+       gdb_client_data instance instead of gdb_client_data pointer.
+       (append_callback_event): Adjust.
+
 2015-07-10  Pierre Langlois  <pierre.langlois@arm.com>
 
        * linux-aarch64-low.c: Add comments for each linux_target_ops
index 08a503f49e7c4e93ba458325ff7059bbf3d2efa6..d1825aeb022f5f50ef540ff161909a001b8eded2 100644 (file)
@@ -130,7 +130,7 @@ struct callback_event
   {
     int id;
     callback_handler_func *proc;
-    gdb_client_data *data;
+    gdb_client_data data;
     struct callback_event *next;
   };
 
@@ -249,7 +249,7 @@ process_callback (void)
   if (event_ptr != NULL)
     {
       callback_handler_func *proc = event_ptr->proc;
-      gdb_client_data *data = event_ptr->data;
+      gdb_client_data data = event_ptr->data;
 
       /* Remove the event before calling PROC,
         more events may get added by PROC.  */
This page took 0.032707 seconds and 4 git commands to generate.