attr_p2_02_packed_member_offset.c (212B)
1 /* Phase 2: packed struct → offsetof(S, b) == 1. 2 * Unpacked offset would be 4. */ 3 struct __attribute__((packed)) S { 4 char a; 5 int b; 6 }; 7 8 int test_main(void) { return (int)__builtin_offsetof(struct S, b); }