public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix pointer assignment with different signedness
@ 2014-01-07 13:57 Yao Qi
  2014-01-07 19:12 ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Yao Qi @ 2014-01-07 13:57 UTC (permalink / raw)
  To: gdb-patches

This patch fixes these build errors below:

../../binutils-gdb/gdb/spu-linux-nat.c: In function ‘spu_symbol_file_add_from_memory’:
../../binutils-gdb/gdb/spu-linux-nat.c:368:3: error: pointer targets in passing argument 2 of ‘spu_proc_xfer_spu’ differ in signedness [-Werror=pointer-sign]
../../binutils-gdb/gdb/spu-linux-nat.c:232:1: note: expected ‘gdb_byte *’ but argument is of type ‘char *’
../../binutils-gdb/gdb/spu-linux-nat.c: In function ‘spu_xfer_partial’:
../../binutils-gdb/gdb/spu-linux-nat.c:598:7: error: pointer targets in passing argument 1 of ‘strtoulst’ differ in signedness [-Werror=pointer-sign]
In file included from ../../binutils-gdb/gdb/defs.h:769:0,
                 from ../../binutils-gdb/gdb/spu-linux-nat.c:21:
../../binutils-gdb/gdb/utils.h:43:15: note: expected ‘const char *’ but argument is of type ‘gdb_byte *’
Is it OK?

gdb:

2014-01-07  Yao Qi  <yao@codesourcery.com>

	* spu-linux-nat.c (spu_symbol_file_add_from_memory): Change
	type of 'id' to gdb_byte.  Cast 'id' to 'const char *'.
	(spu_xfer_partial): Cast 'buf' to 'const char *'.
---
 gdb/spu-linux-nat.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gdb/spu-linux-nat.c b/gdb/spu-linux-nat.c
index cfd5fd9..4c62ec7 100644
--- a/gdb/spu-linux-nat.c
+++ b/gdb/spu-linux-nat.c
@@ -359,7 +359,7 @@ spu_symbol_file_add_from_memory (int inferior_fd)
   ULONGEST addr;
   struct bfd *nbfd;
 
-  char id[128];
+  gdb_byte id[128];
   char annex[32];
   int len;
 
@@ -369,7 +369,7 @@ spu_symbol_file_add_from_memory (int inferior_fd)
   if (len <= 0 || len >= sizeof id)
     return;
   id[len] = 0;
-  addr = strtoulst (id, NULL, 16);
+  addr = strtoulst ((const char *) id, NULL, 16);
   if (!addr)
     return;
 
@@ -596,7 +596,7 @@ spu_xfer_partial (struct target_ops *ops,
       if (spu_proc_xfer_spu (lslr_annex, buf, NULL, 0, sizeof buf) <= 0)
 	return ret;
 
-      lslr = strtoulst (buf, NULL, 16);
+      lslr = strtoulst ((const char *) buf, NULL, 16);
       return spu_proc_xfer_spu (mem_annex, readbuf, writebuf,
 				offset & lslr, len);
     }
-- 
1.7.7.6

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix pointer assignment with different signedness
  2014-01-07 13:57 [PATCH] Fix pointer assignment with different signedness Yao Qi
@ 2014-01-07 19:12 ` Tom Tromey
  2014-01-08  2:48   ` Yao Qi
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2014-01-07 19:12 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

>>>>> "Yao" == Yao Qi <yao@codesourcery.com> writes:

Yao> 2014-01-07  Yao Qi  <yao@codesourcery.com>
Yao> 	* spu-linux-nat.c (spu_symbol_file_add_from_memory): Change
Yao> 	type of 'id' to gdb_byte.  Cast 'id' to 'const char *'.
Yao> 	(spu_xfer_partial): Cast 'buf' to 'const char *'.

Ok.

Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix pointer assignment with different signedness
  2014-01-07 19:12 ` Tom Tromey
@ 2014-01-08  2:48   ` Yao Qi
  0 siblings, 0 replies; 3+ messages in thread
From: Yao Qi @ 2014-01-08  2:48 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On 01/08/2014 03:12 AM, Tom Tromey wrote:
> Yao> 2014-01-07  Yao Qi  <yao@codesourcery.com>
> Yao> 	* spu-linux-nat.c (spu_symbol_file_add_from_memory): Change
> Yao> 	type of 'id' to gdb_byte.  Cast 'id' to 'const char *'.
> Yao> 	(spu_xfer_partial): Cast 'buf' to 'const char *'.
> 
> Ok.

Thanks.  Patch is pushed.

-- 
Yao (齐尧)

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-01-08  2:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-07 13:57 [PATCH] Fix pointer assignment with different signedness Yao Qi
2014-01-07 19:12 ` Tom Tromey
2014-01-08  2:48   ` Yao Qi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).