stap-probe.c: fix -Wpointer-sign

$ 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*.
This commit is contained in:
Pedro Alves 2013-03-07 18:45:51 +00:00
parent 8ac2c12b84
commit fe106009bd
2 changed files with 5 additions and 1 deletions

View 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,

View 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. */