Re: [PATCH] use size_t for the broken ioctl numbers

From: Arnd Bergmann
Date: Sun Sep 07 2003 - 16:29:41 EST


Andreas Schwab wrote:
> Linus Torvalds <torvalds@xxxxxxxx> writes:
>> Ie, change the (sizeof(x)) to something like
>>
>> ({ x __dummy; sizeof(__dummy); })
>>
>> which should work with all compiler versions.
>
> This won't work with array types, eg. in <linux/random.h>:
>
> #define RNDGETPOOL _IOR( 'R', 0x02, int [2] )

How about changing (sizeof(x)) to (sizeof(x[1]))?
It will result in "parse error before `['" when x is not
a type or an array type.

Arnd <><
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/