From fe106009bd9b2b6968256dba016a71e916e211fc Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 7 Mar 2013 18:45:51 +0000 Subject: [PATCH] stap-probe.c: fix -Wpointer-sign MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit $ 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 * stap-probe.c (handle_stap_probe): Add cast to char*. --- gdb/ChangeLog | 4 ++++ gdb/stap-probe.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3b78b08..daa4089 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,9 @@ 2013-03-07 Pedro Alves + * stap-probe.c (handle_stap_probe): Add cast to char*. + +2013-03-07 Pedro Alves + * linux-record.c (record_linux_system_call) : Pass a signed variable to regcache_raw_read_signed, instead of an unsigned one. diff --git a/gdb/stap-probe.c b/gdb/stap-probe.c index 7326a5c..9b67304 100644 --- a/gdb/stap-probe.c +++ b/gdb/stap-probe.c @@ -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. */ -- 2.7.4