diff --git a/kpatch-build/list.h b/kpatch-build/list.h index e95593c83..ad4643c10 100644 --- a/kpatch-build/list.h +++ b/kpatch-build/list.h @@ -30,7 +30,7 @@ /** * Get offset of a member */ -#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) +#define offsetof(TYPE, MEMBER) ((size_t) __builtin_offsetof(TYPE, MEMBER)) /** * Casts a member of a structure out to the containing structure