WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] Re: [Xen-changelog] [xen-unstable] [VMXASSIST] Cast to p

To: Rik van Riel <riel@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Re: [Xen-changelog] [xen-unstable] [VMXASSIST] Cast to pointer type via long to avoid compile
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Thu, 28 Sep 2006 20:53:06 +0100
Delivery-date: Thu, 28 Sep 2006 12:54:11 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <451C2128.7040102@xxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcbjN7cG9VF+Tk8qEduL6AAKle7CWA==
Thread-topic: [Xen-devel] Re: [Xen-changelog] [xen-unstable] [VMXASSIST] Cast to pointer type via long to avoid compile
User-agent: Microsoft-Entourage/11.2.5.060620
On 28/9/06 8:23 pm, "Rik van Riel" <riel@xxxxxxxxxx> wrote:

>> [VMXASSIST] Cast to pointer type via long to avoid compile
>> warnings/errors with latest gcc versions.
>> Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
> 
> 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



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>