This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] Fix -Wpointer-sign warning in sol-thread.c
- From: Joel Brobecker <brobecker at adacore dot com>
- To: gdb-patches at sourceware dot org
- Cc: Joel Brobecker <brobecker at adacore dot com>
- Date: Mon, 6 May 2013 08:57:45 -0400
- Subject: [commit] Fix -Wpointer-sign warning in sol-thread.c
Hello,
I meant to commit this patch a while ago and forgot... Here it is.
Not a big fan of the cast, but the rw_common function is used from
callbacks whose signature is defined and cannot be changed.
gdb/ChangeLog:
* sol-thread.c (rw_common): Cast BUF to "gdb_byte *" in calls
to target_write_memory and target_read_memory.
Tested on sparc-solaris, checked in.
---
gdb/ChangeLog | 5 +++++
gdb/sol-thread.c | 4 ++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 7473b08..14cce79 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2013-05-06 Joel Brobecker <brobecker@adacore.com>
+ * sol-thread.c (rw_common): Cast BUF to "gdb_byte *" in calls
+ to target_write_memory and target_read_memory.
+
+2013-05-06 Joel Brobecker <brobecker@adacore.com>
+
* darwin-nat.c (darwin_setup_fake_stop_event): New function.
(darwin_attach): Adjust using darwin_setup_fake_stop_event.
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index 969bfaf..f5ea3be 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -807,9 +807,9 @@ rw_common (int dowrite, const struct ps_prochandle *ph, gdb_ps_addr_t addr,
#endif
if (dowrite)
- ret = target_write_memory (addr, buf, size);
+ ret = target_write_memory (addr, (gdb_byte *) buf, size);
else
- ret = target_read_memory (addr, buf, size);
+ ret = target_read_memory (addr, (gdb_byte *) buf, size);
do_cleanups (old_chain);
--
1.7.0.4