Fix -Werror=pointer-sign warnings
authorYao Qi <yao@codesourcery.com>
Fri, 7 Feb 2014 06:35:09 +0000 (14:35 +0800)
committerYao Qi <yao@codesourcery.com>
Mon, 17 Feb 2014 03:25:42 +0000 (11:25 +0800)
../../../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-17  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/ChangeLog
gdb/gnu-nat.c

index d972e16e4719870ac8b9486bf1d184bbec5493f2..b28201e6cac60855dfb65e611861ca45ab864bf9 100644 (file)
@@ -1,3 +1,9 @@
+2014-02-17  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.
+
 2014-02-17  Yao Qi  <yao@codesourcery.com>
 
        * gnu-nat.c (proc_get_exception_port): Use 'lu' insetad of 'd'
index 545105f3284ec51d3178d82245eac56817623727..e4140e038253f839777b377de1b98be0a6dc8dda 100644 (file)
@@ -2288,7 +2288,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, &copy_count);
@@ -2335,7 +2335,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";