Print this page
3373 gcc >= 4.5 concerns about offsetof()

*** 368,378 **** --- 368,382 ---- /* avoid any possibility of clashing with <stddef.h> version */ #if defined(_KERNEL) && !defined(_KMEMUSER) #if !defined(offsetof) + #if defined(__GNUC__) + #define offsetof(s, m) __builtin_offsetof(s, m) + #else #define offsetof(s, m) ((size_t)(&(((s *)0)->m))) + #endif #endif /* !offsetof */ #define container_of(m, s, name) \ (void *)((uintptr_t)(m) - (uintptr_t)offsetof(s, name))