diff options
author | Pedro Alves <palves@redhat.com> | 2013-03-07 23:36:01 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2013-03-07 23:36:01 +0000 |
commit | c8af03a2f5d51f4c2de96ad9b6431553f0208f5c (patch) | |
tree | 47c0b581b061ae06a5cb2db60e1b181bf58a3cb6 | |
parent | 4bead2d512271ca2a0dee6172042558795b134cc (diff) | |
download | gdb-c8af03a2f5d51f4c2de96ad9b6431553f0208f5c.zip gdb-c8af03a2f5d51f4c2de96ad9b6431553f0208f5c.tar.gz gdb-c8af03a2f5d51f4c2de96ad9b6431553f0208f5c.tar.bz2 |
corefile.c: fix -Wpointer-sign
$ make WERROR_CFLAGS="-Wpointer-sign -Werror" corefile.o -k 2>&1 1>/dev/null
../../src/gdb/corefile.c: In function ‘read_memory_string’:
../../src/gdb/corefile.c:334:7: error: pointer targets in passing argument 2 of ‘read_memory’ differ in signedness [-Werror=pointer-sign]
../../src/gdb/corefile.c:217:1: note: expected ‘gdb_byte *’ but argument is of type ‘char *’
Functions that take or return ascii-ish string arguments usually use
char* for parameters/return. That means that at points we call into
target methods that work with binary blobs, we need casts to
gdb_byte*.
gdb/
2013-03-07 Pedro Alves <palves@redhat.com>
* corefile.c (read_memory_string): Cast pointer to gdb_byte* in
call.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/corefile.c | 2 |
2 files changed, 6 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 87ffb54..29203fe 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2013-03-07 Pedro Alves <palves@redhat.com> + + * corefile.c (read_memory_string): Cast pointer to gdb_byte* in + call. + 2013-03-07 Keith Seitz <keiths@redhat.com> * breakpoint.c (catch_syscall_split_args): Use skip_spaces. diff --git a/gdb/corefile.c b/gdb/corefile.c index b268d4c..9c795b8 100644 --- a/gdb/corefile.c +++ b/gdb/corefile.c @@ -331,7 +331,7 @@ read_memory_string (CORE_ADDR memaddr, char *buffer, int max_len) cnt = max_len - (cp - buffer); if (cnt > 8) cnt = 8; - read_memory (memaddr + (int) (cp - buffer), cp, cnt); + read_memory (memaddr + (int) (cp - buffer), (gdb_byte *) cp, cnt); for (i = 0; i < cnt && *cp; i++, cp++) ; /* null body */ |