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] breakpoint.c: fix -Wpointer-sign


$ make WERROR_CFLAGS="-Wpointer-sign -Werror" breakpoint.o 2>&1 1>/dev/null
../../src/gdb/breakpoint.c: In function âbreakpoint_xfer_memoryâ:
../../src/gdb/breakpoint.c:1578:2: error: pointer targets in passing argument 3 of âgdbarch_breakpoint_from_pcâ differ in signedness [-Werror=pointer-sign]
In file included from ../../src/gdb/defs.h:644:0,
                 from ../../src/gdb/breakpoint.c:20:
../../src/gdb/gdbarch.h:495:25: note: expected âint *â but argument is of type âunsigned int *â

target_info.placed_size is an 'int', and gdbarch_breakpoint_from_pc
takes an int too.

gdb/
2013-03-07  Pedro Alves  <palves@redhat.com>

	* breakpoint.c (breakpoint_xfer_memory): Change type of local to
	int.
---
 gdb/breakpoint.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index fb57a57..d71bb36 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -1567,7 +1567,7 @@ breakpoint_xfer_memory (gdb_byte *readbuf, gdb_byte *writebuf,
 	struct gdbarch *gdbarch = bl->gdbarch;
 	const unsigned char *bp;
 	CORE_ADDR placed_address = bl->target_info.placed_address;
-	unsigned placed_size = bl->target_info.placed_size;
+	int placed_size = bl->target_info.placed_size;
 
 	/* Update the shadow with what we want to write to memory.  */
 	memcpy (bl->target_info.shadow_contents + bptoffset,


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