regcache.c: fix -Wpointer-sign
authorPedro Alves <palves@redhat.com>
Thu, 7 Mar 2013 18:59:54 +0000 (18:59 +0000)
committerPedro Alves <palves@redhat.com>
Thu, 7 Mar 2013 18:59:54 +0000 (18:59 +0000)
$ make WERROR_CFLAGS="-Wpointer-sign -Werror" regcache.o 2>&1 1>/dev/null
../../src/gdb/regcache.c: In function ‘regcache_xmalloc_1’:
../../src/gdb/regcache.c:228:2: error: pointer targets in assignment differ in signedness [-Werror=pointer-sign]
../../src/gdb/regcache.c:235:2: error: pointer targets in assignment differ in signedness [-Werror=pointer-sign]
cc1: all warnings being treated as errors

regcache->register_status is "signed char".

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

* regcache.c (regcache_xmalloc_1): Call XCALLOC with signed char
for 'regcache->register_status'.

gdb/ChangeLog
gdb/regcache.c

index 251b60df259d497b75d83dbf47e916b79963a936..ceeecb705eeca263f3b5615346f28e6eb2f4dfa6 100644 (file)
@@ -1,3 +1,8 @@
+2013-03-07  Pedro Alves  <palves@redhat.com>
+
+       * regcache.c (regcache_xmalloc_1): Call XCALLOC with signed char
+       for 'regcache->register_status'.
+
 2013-03-07  Pedro Alves  <palves@redhat.com>
 
        * breakpoint.c (breakpoint_xfer_memory): Change type of local to
index ca00f90d184a154ae87dea70ea37e04b2178bb25..57d29e4b6434cb0a556f8f2a3b71d2ae373e6bba 100644 (file)
@@ -225,14 +225,14 @@ regcache_xmalloc_1 (struct gdbarch *gdbarch, struct address_space *aspace,
       regcache->registers
        = XCALLOC (descr->sizeof_cooked_registers, gdb_byte);
       regcache->register_status
-       = XCALLOC (descr->sizeof_cooked_register_status, gdb_byte);
+       = XCALLOC (descr->sizeof_cooked_register_status, signed char);
     }
   else
     {
       regcache->registers
        = XCALLOC (descr->sizeof_raw_registers, gdb_byte);
       regcache->register_status
-       = XCALLOC (descr->sizeof_raw_register_status, gdb_byte);
+       = XCALLOC (descr->sizeof_raw_register_status, signed char);
     }
   regcache->aspace = aspace;
   regcache->ptid = minus_one_ptid;