This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[committed] Fix -Wpointer-sign warning in ctf.c
- From: Yao Qi <yao at codesourcery dot com>
- To: <gdb-patches at sourceware dot org>
- Date: Sat, 20 Apr 2013 15:37:41 +0800
- Subject: [committed] Fix -Wpointer-sign warning in ctf.c
Hi,
I see a build warning in current trunk when gdb is built with
libbabeltrace. Local variable 'regs' contains the contents of register
red from the trace file, so its type should be 'gdb_byte *'. On the
other hand, As a clone of tfile_fetch_registers, local variable 'regs'
is of type 'gdb_byte *' in tfile_fetch_registers, so we should use
the same type here.
Rebuild GDB in x86-linux and cross build with mingw32. Committed.
gdb:
2013-04-20 Yao Qi <yao@codesourcery.com>
* ctf.c (ctf_fetch_registers): Change the type of 'regs' from
'char *' to 'gdb_byte *'. Cast the return value of
'bt_ctf_get_char_array' to 'gdb_byte *'.
---
gdb/ctf.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdb/ctf.c b/gdb/ctf.c
index e4b98e9..8774ae8 100644
--- a/gdb/ctf.c
+++ b/gdb/ctf.c
@@ -1237,7 +1237,7 @@ ctf_fetch_registers (struct target_ops *ops,
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
int offset, regn, regsize, pc_regno;
- char *regs = NULL;
+ gdb_byte *regs = NULL;
struct bt_ctf_event *event = NULL;
struct bt_iter_pos *pos;
@@ -1283,7 +1283,7 @@ ctf_fetch_registers (struct target_ops *ops,
const struct bt_definition *array
= bt_ctf_get_field (event, scope, "contents");
- regs = bt_ctf_get_char_array (array);
+ regs = (gdb_byte *) bt_ctf_get_char_array (array);
/* Assume the block is laid out in GDB register number order,
each register with the size that it has in GDB. */
offset = 0;
--
1.7.7.6