This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[COMMIT PATCH] 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*.
---
 gdb/stap-probe.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]