From: Keir Fraser Subject: Re: Re: [Xen-changelog] [xen-unstable] [VMXASSIST] Cast to pointer type via long to avoid compile Date: Thu, 28 Sep 2006 20:53:06 +0100 Message-ID: References: <451C2128.7040102@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <451C2128.7040102@redhat.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Rik van Riel , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 28/9/06 8:23 pm, "Rik van Riel" wrote: >> [VMXASSIST] Cast to pointer type via long to avoid compile >> warnings/errors with latest gcc versions. >> Signed-off-by: Keir Fraser > > Are you sure you don't want these to be unsigned, seeing that > the x86-64 kernels have the top bit set for kernel addresses? It's the original type that determines whether sign extension happens, and they are u32 or u64, so there are no sign-extending issues in the type change from u32/u64 to long. 'long' is the same size as a pointer on x86, so no widening/narrowing happens in the final cast to pointer type, so there are also no sign-extending issues in the type change from long to pointer. So the code should be fine as is and avoiding 'unsigned long' means we don't end up wrapping 80 columns or needing extra line breaks. -- Keir