stap-probe.c: fix -Wpointer-sign
authorPedro Alves <palves@redhat.com>
Thu, 7 Mar 2013 18:45:51 +0000 (18:45 +0000)
committerPedro Alves <palves@redhat.com>
Thu, 7 Mar 2013 18:45:51 +0000 (18:45 +0000)
$ make WERROR_CFLAGS="-Wpointer-sign -Werror" stap-probe.o 2>&1 1>/dev/null
../../src/gdb/stap-probe.c: In function ‘handle_stap_probe’:
../../src/gdb/stap-probe.c:1306:19: error: pointer targets in assignment differ in signedness [-Werror=pointer-sign]
cc1: all warnings being treated as errors
make: *** [stap-probe.o] Error 1

provider is a string, so it's rightfully a char*.  'data' holds raw
bytes (bfd_byte), so a cast is the right thing to do.

gdb/
2013-03-07  Pedro Alves  <palves@redhat.com>

* stap-probe.c (handle_stap_probe): Add cast to char*.

gdb/ChangeLog
gdb/stap-probe.c

index 3b78b08..daa4089 100644 (file)
@@ -1,5 +1,9 @@
 2013-03-07  Pedro Alves  <palves@redhat.com>
 
+       * stap-probe.c (handle_stap_probe): Add cast to char*.
+
+2013-03-07  Pedro Alves  <palves@redhat.com>
+
        * linux-record.c (record_linux_system_call) <gdb_sys_msgrcv,
        RECORD_MSGRCV>: Pass a signed variable to
        regcache_raw_read_signed, instead of an unsigned one.
index 7326a5c..9b67304 100644 (file)
@@ -1303,7 +1303,7 @@ handle_stap_probe (struct objfile *objfile, struct sdt_note *el,
   ret->p.objfile = objfile;
 
   /* Provider and the name of the probe.  */
-  ret->p.provider = &el->data[3 * size];
+  ret->p.provider = (char *) &el->data[3 * size];
   ret->p.name = memchr (ret->p.provider, '\0',
                        (char *) el->data + el->size - ret->p.provider);
   /* Making sure there is a name.  */