* Rudolf Marek r.marek@assembler.cz [070629 15:36]:
Hi,
Just a short comment:
-#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) +#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) \
- sizeof(typeof(int[1 - 2*!!__builtin_types_compatible_p(typeof(arr), \
typeof(&arr[0]))]))*0)
-- Rusty Russell http://lwn.net/Articles/226010/
Maybe we will need something more insane too?
I suggest we rather expect people to know what they are doing. Feeding a non-array into a macro ARRAY_SIZE is not completely unlikely to happen but adding trickery like the above will not make us any friends among those trying to understand the code.