|
|
|
|
|
|
|
|
|
|
xen-devel
Re: [Xen-devel] Re: [Xen-changelog] [xen-unstable] [VMXASSIST] Cast to p
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
|
|
|
|
|