1 #include <stdio.h> 2 3 4 struct foo { 5 int x; 6 double y; 7 } __attribute__((aligned(16))) f; 8 9 10 struct bar { 11 int x; 12 long double y; 13 } __attribute__((packed)); 14 15 struct baz { 16 int x __attribute__((aligned(16))); 17 }; 18 19 20 int main()21main() { 22 struct bar b; 23 printf("%d\n", (int)__alignof(struct foo)); 24 printf("%d,%d\n", (int)__alignof(struct bar), (int)sizeof b); 25 printf("%d\n", (int)__alignof(struct baz)); 26 } 27 28