This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 2/3] Fix -Werror=pointer-sign warnings
- From: Yao Qi <yao at codesourcery dot com>
- To: <gdb-patches at sourceware dot org>
- Date: Fri, 7 Feb 2014 15:59:17 +0800
- Subject: [PATCH 2/3] Fix -Werror=pointer-sign warnings
- Authentication-results: sourceware.org; auth=none
- References: <1391759958-972-1-git-send-email-yao at codesourcery dot com>
../../../git/gdb/gnu-nat.c: In function 'gnu_read_inferior':
../../../git/gdb/gnu-nat.c:2282:3: error: pointer targets in passing argument 5 of 'vm_read' differ in signedness [-Werror=pointer-sign]
In file included from /home/yao/Software/hurd-toolchain/bin/../i686-pc-gnu/libc/usr/include/mach.h:38:0,
from ./nm.h:23,
from ../../../git/gdb/defs.h:500,
from ../../../git/gdb/gnu-nat.c:23:
/home/yao/Software/hurd-toolchain/bin/../i686-pc-gnu/libc/usr/include/mach/mach_interface.h:843:15: note: expected 'mach_msg_type_number_t *' but argument is of type 'int *'
../../../git/gdb/gnu-nat.c: In function 'gnu_write_inferior':
../../../git/gdb/gnu-nat.c:2339:4: error: pointer targets in passing argument 5 of 'vm_read' differ in signedness [-Werror=pointer-sign]
In file included from /home/yao/Software/hurd-toolchain/bin/../i686-pc-gnu/libc/usr/include/mach.h:38:0,
from ./nm.h:23,
from ../../../git/gdb/defs.h:500,
from ../../../git/gdb/gnu-nat.c:23:
/home/yao/Software/hurd-toolchain/bin/../i686-pc-gnu/libc/usr/include/mach/mach_interface.h:843:15: note: expected 'mach_msg_type_number_t *' but argument is of type 'int *'
This patch fixes these warnings.
gdb:
2014-02-07 Yao Qi <yao@codesourcery.com>
* gnu-nat.c (gnu_read_inferior): Change 'copy_count' type to
mach_msg_type_number_t.
(gnu_write_inferior): Likewise.
---
gdb/gnu-nat.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
index 6e65446..d5ce416 100644
--- a/gdb/gnu-nat.c
+++ b/gdb/gnu-nat.c
@@ -2276,7 +2276,7 @@ gnu_read_inferior (task_t task, CORE_ADDR addr, gdb_byte *myaddr, int length)
vm_size_t aligned_length =
(vm_size_t) round_page (addr + length) - low_address;
pointer_t copied;
- int copy_count;
+ mach_msg_type_number_t copy_count;
/* Get memory from inferior with page aligned addresses. */
err = vm_read (task, low_address, aligned_length, &copied, ©_count);
@@ -2323,7 +2323,7 @@ gnu_write_inferior (task_t task, CORE_ADDR addr,
vm_size_t aligned_length =
(vm_size_t) round_page (addr + length) - low_address;
pointer_t copied;
- int copy_count;
+ mach_msg_type_number_t copy_count;
int deallocate = 0;
char *errstr = "Bug in gnu_write_inferior";
--
1.7.7.6