[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] user-exec: alpha-host: Add type cast to avoid compi
From: |
gchen gchen |
Subject: |
[Qemu-devel] [PATCH] user-exec: alpha-host: Add type cast to avoid compiling warning |
Date: |
Wed, 12 Aug 2015 13:58:52 +0800 |
The related building warnings in alpha virtual machine:
CC i386-linux-user/user-exec.o
user-exec.c: In function 'cpu_x86_signal_handler':
user-exec.c:363:20: error: initialization makes pointer from integer without
a cast [-Werror=int-conversion]
uint32_t *pc = uc->uc_mcontext.sc_pc;
^
user-exec.c:383:30: error: passing argument 1 of 'handle_cpu_signal' makes
integer from pointer without a cast [-Werror=int-conversion]
return handle_cpu_signal(pc, (unsigned long)info->si_addr,
^
user-exec.c:86:19: note: expected 'uintptr_t {aka long unsigned int}' but
argument is of type 'uint32_t * {aka unsigned int *}'
static inline int handle_cpu_signal(uintptr_t pc, unsigned long address,
^
Signed-off-by: Chen Gang <address@hidden>
---
user-exec.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/user-exec.c b/user-exec.c
index ed9a07f..baaeb09 100644
--- a/user-exec.c
+++ b/user-exec.c
@@ -360,7 +360,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
{
siginfo_t *info = pinfo;
struct ucontext *uc = puc;
- uint32_t *pc = uc->uc_mcontext.sc_pc;
+ uint32_t *pc = (uint32_t *)uc->uc_mcontext.sc_pc;
uint32_t insn = *pc;
int is_write = 0;
@@ -380,7 +380,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
is_write = 1;
}
- return handle_cpu_signal(pc, (unsigned long)info->si_addr,
+ return handle_cpu_signal((unsigned long)pc, (unsigned long)info->si_addr,
is_write, &uc->uc_sigmask, puc);
}
#elif defined(__sparc__)
--
1.9.1
- [Qemu-devel] [PATCH] user-exec: alpha-host: Add type cast to avoid compiling warning,
gchen gchen <=