This is the mail archive of the
gdb-cvs@sourceware.org
mailing list for the GDB project.
[binutils-gdb/gdb-7.12-branch] [GDBserver] Fix conversion warning
- From: Yao Qi <qiyao at sourceware dot org>
- To: gdb-cvs at sourceware dot org
- Date: 24 Oct 2016 10:58:54 -0000
- Subject: [binutils-gdb/gdb-7.12-branch] [GDBserver] Fix conversion warning
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a945860b6cb4f8a26343ac5dcb0b42fe5fb2f68a
commit a945860b6cb4f8a26343ac5dcb0b42fe5fb2f68a
Author: Yao Qi <yao.qi@linaro.org>
Date: Mon Oct 24 10:59:11 2016 +0100
[GDBserver] Fix conversion warning
I got the following warning if I build GDBserver for aarch64_be-linux-gnu,
git/gdb/gdbserver/linux-aarch64-low.c:1539:39: error: invalid conversion from 'void*' to 'uint32_t* {aka unsigned int*}' [-fpermissive]
uint32_t *le_buf = xmalloc (byte_len);
^
The patch is to fix the warning.
gdb/gdbserver:
2016-10-24 Yao Qi <yao.qi@linaro.org>
PR server/20733
* linux-aarch64-low.c (append_insns): Cast the return value to
'uint32_t *'.
Diff:
---
gdb/gdbserver/ChangeLog | 6 ++++++
gdb/gdbserver/linux-aarch64-low.c | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index e2c43a7..40809d6 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,9 @@
+2016-10-24 Yao Qi <yao.qi@linaro.org>
+
+ PR server/20733
+ * linux-aarch64-low.c (append_insns): Cast the return value to
+ 'uint32_t *'.
+
2016-09-21 Yao Qi <yao.qi@linaro.org>
* linux-aarch32-low.c (arm_fill_gregset): Keep bits 20 to
diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c
index e54a8ba..ae80cdd 100644
--- a/gdb/gdbserver/linux-aarch64-low.c
+++ b/gdb/gdbserver/linux-aarch64-low.c
@@ -1536,7 +1536,7 @@ append_insns (CORE_ADDR *to, size_t len, const uint32_t *buf)
{
size_t byte_len = len * sizeof (uint32_t);
#if (__BYTE_ORDER == __BIG_ENDIAN)
- uint32_t *le_buf = xmalloc (byte_len);
+ uint32_t *le_buf = (uint32_t *) xmalloc (byte_len);
size_t i;
for (i = 0; i < len; i++)