Re: [PATCH] Use more gcc extensions in the Linux headers

From: Jarek Poplawski
Date: Fri Mar 09 2007 - 03:32:10 EST


On 09-03-2007 08:52, Christoph Hellwig wrote:
> On Fri, Mar 09, 2007 at 04:56:32PM +1100, Rusty Russell wrote:
...
>> +#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) \
>> + + sizeof(typeof(int[1 - 2*!!__builtin_types_compatible_p(typeof(arr), \
>> + typeof(&arr[0]))]))*0)
>
> This needs a comment explaning why we're doing this, and maybe a little
> explanation of the combination of gcc magic and C trickery used to implement
> it to the brave non-uberhacker people trying to understand linux headers.

...and to deprive them of all the pleasure of contemplating...

Jarek P.
-
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/