From 8ac2c12b843ac2f5956bab975a1f855b70fe4fe0 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 7 Mar 2013 18:29:05 +0000 Subject: [PATCH] linux-record.c:record_linux_system_call: fix -Wpointer-sign MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit $ make WERROR_CFLAGS="-Wpointer-sign -Werror" linux-record.o 2>&1 1>/dev/null ... ../../src/gdb/linux-record.c: In function ‘record_linux_system_call’: ../../src/gdb/linux-record.c:1152:9: error: pointer targets in passing argument 3 of ‘regcache_raw_read_signed’ differ in signedness [-Werror=pointer-sign] In file included from ../../src/gdb/linux-record.c:23:0: ../../src/gdb/regcache.h:76:3: note: expected ‘long int *’ but argument is of type ‘long unsigned int *’ ../../src/gdb/linux-record.c:1186:13: error: pointer targets in passing argument 3 of ‘regcache_raw_read_signed’ differ in signedness [-Werror=pointer-sign] In file included from ../../src/gdb/linux-record.c:23:0: ../../src/gdb/regcache.h:76:3: note: expected ‘long int *’ but argument is of type ‘long unsigned int *’ I believe the read_signed calls are correct, and the variables are in the wrong. Tested on x86_64 Fedora 17. gdb/ 2013-03-07 Pedro Alves * linux-record.c (record_linux_system_call) : Pass a signed variable to regcache_raw_read_signed, instead of an unsigned one. --- gdb/ChangeLog | 6 ++++++ gdb/linux-record.c | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 59225c4..3b78b08 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2013-03-07 Pedro Alves + * linux-record.c (record_linux_system_call) : Pass a signed variable to + regcache_raw_read_signed, instead of an unsigned one. + +2013-03-07 Pedro Alves + * remote-notif.c (notif_debug): Change type to int. * remote-notif.h (notif_debug): Likewise. diff --git a/gdb/linux-record.c b/gdb/linux-record.c index 5a9ec99..c769700 100644 --- a/gdb/linux-record.c +++ b/gdb/linux-record.c @@ -1148,10 +1148,11 @@ Do you want to stop the program?"), case gdb_sys_msgrcv: { ULONGEST msgp; + LONGEST l; - regcache_raw_read_signed (regcache, tdep->arg3, &tmpulongest); + regcache_raw_read_signed (regcache, tdep->arg3, &l); regcache_raw_read_unsigned (regcache, tdep->arg2, &msgp); - tmpint = (int) tmpulongest + tdep->size_long; + tmpint = l + tdep->size_long; if (record_arch_list_add_mem ((CORE_ADDR) msgp, tmpint)) return -1; } @@ -1180,7 +1181,7 @@ Do you want to stop the program?"), break; case RECORD_MSGRCV: { - ULONGEST second; + LONGEST second; ULONGEST ptr; regcache_raw_read_signed (regcache, tdep->arg3, &second); -- 2.7.4