lkml.org 
[lkml]   [2012]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] staging: comedi: remove __user annotation inside of struct's
    On Wed, May 09, 2012 at 12:01:25PM +0100, Ian Abbott wrote:
    > Are there any handy macros for casting pointers to __user pointers,
    > something like
    >
    > #define _user(p) ((typeof(*(p)) __user *)(p))
    >
    > but preferably without the repeated expansion of 'p' in case of
    > side-effects?

    typeof() doesn't have side effects.

    #include <stdio.h>

    int main(void)
    {
    int x = 0;
    typeof(x++) y;

    printf("%d\n", x);

    return 0;
    }

    regards,
    dan carpenter


    \
     
     \ /
      Last update: 2012-05-09 16:42    [W:0.023 / U:0.084 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site