From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KAfhu-00078J-BZ for qemu-devel@nongnu.org; Mon, 23 Jun 2008 02:39:18 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KAfhs-00077a-M5 for qemu-devel@nongnu.org; Mon, 23 Jun 2008 02:39:17 -0400 Received: from [199.232.76.173] (port=51570 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KAfhs-00077V-Dg for qemu-devel@nongnu.org; Mon, 23 Jun 2008 02:39:16 -0400 Received: from rv-out-0708.google.com ([209.85.198.251]:17885) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KAfhs-0007rP-5h for qemu-devel@nongnu.org; Mon, 23 Jun 2008 02:39:16 -0400 Received: by rv-out-0708.google.com with SMTP id f25so6769659rvb.22 for ; Sun, 22 Jun 2008 23:39:14 -0700 (PDT) Message-ID: <761ea48b0806222339o32cb67e7w3e539c76c6879413@mail.gmail.com> Date: Mon, 23 Jun 2008 08:39:14 +0200 From: "Laurent Desnogues" Subject: Re: [Qemu-devel] exec.c:283: warning: cast from pointer to integer of different size In-Reply-To: <485F4295.3050805@web.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <485F4295.3050805@web.de> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On Mon, Jun 23, 2008 at 8:28 AM, Jan Kiszka wrote: > Hi Paul, > > trying to get rid of some of the various compiler warnings, specifically > on 64-bit hosts, I came across this: > >> #if defined(CONFIG_USER_ONLY) >> unsigned long addr; >> size_t len = sizeof(PageDesc) * L2_SIZE; >> /* Don't use qemu_malloc because it may recurse. */ >> p = mmap(0, len, PROT_READ | PROT_WRITE, >> MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); >> *lp = p; >> addr = h2g(p); >> if (addr == (target_ulong)addr) { >> page_set_flags(addr & TARGET_PAGE_MASK, >> TARGET_PAGE_ALIGN(addr + len), >> PAGE_RESERVED); >> } >> #else > > Something is fishy here. h2g already returns target_ulong (and generates > compiler warnings at this chance), but the succeeding line seems to > assume that addr can still be larger than that. Now I wonder what this > code is actually supposed to do. I already reported this two weeks ago and got no feedback. http://lists.gnu.org/archive/html/qemu-devel/2008-06/msg00324.html Laurent