#include #include #define ALIGNEDP(x) __attribute__((aligned(x),packed)) #define ALIGNED(x) __attribute__((aligned(x))) struct s1 { uint32_t a; uint16_t b; uint32_t c; char d ALIGNED(16/__CHAR_BIT__); char e ALIGNED(16/__CHAR_BIT__); } ALIGNEDP(16/__CHAR_BIT__); typedef struct s1 s1_t; void main(void) { volatile int i,j,k; i = sizeof(s1_t); j = offsetof(struct s1,d); k = offsetof(struct s1,e); }