From patchwork Mon Aug 17 01:59:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Chen Gang X-Patchwork-Id: 507740 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id F3A6314012C for ; Mon, 17 Aug 2015 12:00:06 +1000 (AEST) Received: from localhost ([::1]:53899 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZR9iV-00040V-N0 for incoming@patchwork.ozlabs.org; Sun, 16 Aug 2015 22:00:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40171) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZR9i2-0003GZ-Dx for qemu-devel@nongnu.org; Sun, 16 Aug 2015 21:59:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZR9hy-0001En-VW for qemu-devel@nongnu.org; Sun, 16 Aug 2015 21:59:34 -0400 Received: from col004-omc3s1.hotmail.com ([65.55.34.139]:55598) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZR9hy-0001Ec-OY for qemu-devel@nongnu.org; Sun, 16 Aug 2015 21:59:30 -0400 Received: from COL130-W85 ([65.55.34.137]) by COL004-OMC3S1.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Sun, 16 Aug 2015 18:59:29 -0700 X-TMN: [JdrtWoXCTQapALiJ2iUyevW81zO0Aj27] X-Originating-Email: [xili_gchen_5257@hotmail.com] Message-ID: From: gchen gchen To: "riku.voipio@iki.fi" , Richard Henderson Date: Mon, 17 Aug 2015 09:59:29 +0800 Importance: Normal In-Reply-To: <55D13FD9.6070201@hotmail.com> References: <55CAE021.80308@hotmail.com> , <55D13FD9.6070201@hotmail.com> MIME-Version: 1.0 X-OriginalArrivalTime: 17 Aug 2015 01:59:29.0959 (UTC) FILETIME=[5A896B70:01D0D890] X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 65.55.34.139 Cc: QEMU Developers Subject: Re: [Qemu-devel] [PATCH] user-exec: alpha-host: Add type cast to avoid compiling warning X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Oh, it has been fixed, but did not merge into master branch. commit b9b331a737f2cd34614355cc8facbbc49fc9816d Author: Richard Henderson Date: Fri Jan 29 15:28:51 2010 -0800 tcg-alpha: Fix type mismatch errors in cpu_signal_handler. Signed-off-by: Richard Henderson On 2015年08月12日 13:58, gchen gchen wrote: > 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 > --- > 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 > > --- Chen Gang Open, share, and attitude like air, water, and life which God blessed diff --git a/user-exec.c b/user-exec.c index bc58056..27c0f3d 100644 --- a/user-exec.c +++ b/user-exec.c @@ -358,8 +358,8 @@ 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 insn = *pc; + unsigned long pc = uc->uc_mcontext.sc_pc; + uint32_t insn = *(uint32_t *)pc; int is_write = 0; /* XXX: need kernel patch to get write flag faster */