From a09b444817a6a61ec6323e7e6dcc4ccbf465826f Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 7 Mar 2013 18:59:54 +0000 Subject: regcache.c: fix -Wpointer-sign MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit $ 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 * regcache.c (regcache_xmalloc_1): Call XCALLOC with signed char for 'regcache->register_status'. --- gdb/ChangeLog | 5 +++++ gdb/regcache.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 251b60d..ceeecb7 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2013-03-07 Pedro Alves + * regcache.c (regcache_xmalloc_1): Call XCALLOC with signed char + for 'regcache->register_status'. + +2013-03-07 Pedro Alves + * breakpoint.c (breakpoint_xfer_memory): Change type of local to int. diff --git a/gdb/regcache.c b/gdb/regcache.c index ca00f90..57d29e4 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -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; -- cgit v1.1