That is incorrect,
&(type *)0 will not even compile, its an absolute (constant) value , it needs a memory location, and a valid one too.
(int)& (((type*)0)->member) should suffice, C compiler will then take it as an address relative to start of structure and hence will give the offset.
Anónimo
10 oct 2009
-->args
x - field
y - structure
#define GETBYTEOFFSET(x,y)
{ \
&(y) - &(y.x); \
}