[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Re: [Xen-changelog] [xen-unstable] [VMXASSIST] Cast to pointer type via long to avoid compile


  • To: Rik van Riel <riel@xxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • 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
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AcbjN7cG9VF+Tk8qEduL6AAKle7CWA==
  • Thread-topic: [Xen-devel] Re: [Xen-changelog] [xen-unstable] [VMXASSIST] Cast to pointer type via long to avoid compile

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.