]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
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 3b78b087ee65e10036348e116fc7d59579420696..daa4089763a2b94d4ed00e42a45782ecc1913c54 100644 (file)
@@ -1,3 +1,7 @@
+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,
index 7326a5c89e1323b28ac8a5f13ffd53d040592521..9b6730450b7ef1036a8d2b55415155a5c5e66afa 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.  */