lkml.org 
[lkml]   [2012]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [TRIVIAL PATCH 16/26] x86: Convert print_symbol to %pSR
On 12/13/2012 10:37 AM, Borislav Petkov wrote:
>>
>> If appropriate, the code could be changed to
>>
>> (void *)(unsigned long)m->ip
>
> Can we explicitly cast it to what it is so that we can be explicit as to
> what we're casting it? IOW:
>
> (void *)(__u64)m->ip;
>
> Does that even work on 32bit?
>
> Also, does the compiler bitch about this useless cast when building with
> W=123?
>

Uh... no.

The point is that (void *)(unsigned long) casts it to an integer of
pointer size -- in userspace you would to (void *)(size_t) or (void
*)(uintptr_t) -- so that the compiler knows "I meant to do that."

-hpa




\
 
 \ /
  Last update: 2012-12-13 20:01    [W:1.104 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site