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]

[PATCH] Fix -Wpointer-sign warning in remote-sim.c


Hi,

I've noticed these messages when building gdb head for ppc64:

gcc -g3 -mminimal-toc  -I. -I../../gdb.git/gdb -I../../gdb.git/gdb/common -I../../gdb.git/gdb/config -DLOCALEDIR="\"/usr/local/share/locale\"" -DHAVE_CONFIG_H -I../../gdb.git/gdb/../include/opcode -I../../gdb.git/gdb/../opcodes/.. -I../../gdb.git/gdb/../readline/.. -I../bfd -I../../gdb.git/gdb/../bfd -I../../gdb.git/gdb/../include -I../libdecnumber -I../../gdb.git/gdb/../libdecnumber  -I../../gdb.git/gdb/gnulib/import -Ibuild-gnulib/import   -DTUI=1  -I/usr/include/python2.6 -I/usr/include/python2.6 -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wpointer-sign -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wmissing-prototypes -Wdeclaration-after-statement -Wempty-body -Werror -c -o remote-sim.o -MT remote-sim.o -MMD -MP -MF .deps/remote-sim.Tpo ../../gdb.git/gdb/remote-sim.c
cc1: warnings being treated as errors
../../gdb.git/gdb/remote-sim.c: In function âgdbsim_fetch_registerâ:
../../gdb.git/gdb/remote-sim.c:493: error: pointer targets in passing argument 1 of âdump_memâ differ in signedness
../../gdb.git/gdb/remote-sim.c:274: note: expected âchar *â but argument is of type âgdb_byte *â
../../gdb.git/gdb/remote-sim.c: In function âgdbsim_store_registerâ:
../../gdb.git/gdb/remote-sim.c:520: error: pointer targets in passing argument 3 of âregcache_cooked_readâ differ in signedness
../../gdb.git/gdb/regcache.h:104: note: expected âgdb_byte *â but argument is of type âchar *â
../../gdb.git/gdb/remote-sim.c:524: error: pointer targets in passing argument 3 of âsim_store_registerâ differ in signedness
../../gdb.git/gdb/../include/gdb/remote-sim.h:203: note: expected âunsigned char *â but argument is of type âchar *â
../../gdb.git/gdb/remote-sim.c: In function âgdbsim_xfer_inferior_memoryâ:
../../gdb.git/gdb/remote-sim.c:1096: error: pointer targets in passing argument 1 of âdump_memâ differ in signedness
../../gdb.git/gdb/remote-sim.c:274: note: expected âchar *â but argument is of type âgdb_byte *â
../../gdb.git/gdb/remote-sim.c:1107: error: pointer targets in passing argument 1 of âdump_memâ differ in signedness
../../gdb.git/gdb/remote-sim.c:274: note: expected âchar *â but argument is of type âgdb_byte *â

The following patch fixes them. Ok to apply?

Thanks and regards,
--
Edjunior.

gdb/ChangeLog
2013-04-22  Edjunior Machado  <emachado@linux.vnet.ibm.com>

	* remote-sim.c (dump_mem): Change the type of 'buf' parameter from
	'char *' to 'gdb_byte *'.
	(gdbsim_store_register): Change the type of 'tmp' from 'char' to
	'gdb_byte'.

---
 gdb/remote-sim.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index ae03950..fda3735 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -46,7 +46,7 @@
 
 extern void _initialize_remote_sim (void);
 
-static void dump_mem (char *buf, int len);
+static void dump_mem (gdb_byte *buf, int len);
 
 static void init_callbacks (void);
 
@@ -271,7 +271,7 @@ sim_inferior_data_cleanup (struct inferior *inf, void *data)
 }
 
 static void
-dump_mem (char *buf, int len)
+dump_mem (gdb_byte *buf, int len)
 {
   printf_filtered ("\t");
 
@@ -514,7 +514,7 @@ gdbsim_store_register (struct target_ops *ops,
     }
   else if (gdbarch_register_sim_regno (gdbarch, regno) >= 0)
     {
-      char tmp[MAX_REGISTER_SIZE];
+      gdb_byte tmp[MAX_REGISTER_SIZE];
       int nr_bytes;
 
       regcache_cooked_read (regcache, regno, tmp);
-- 
1.7.1


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