Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- quentin@chrystal ~/tmp $ cat align.c 0
- #include <stdio.h>
- struct foo {
- int teton;
- char bar;
- unsigned long foo;
- char foobar;
- } __attribute__((align(32)));
- struct foo my_array[42];
- struct foo my_array[42] __attribute__((align(32)));
- int main(void)
- {
- printf("sizeof==%lu, %p %p\n", sizeof(struct foo), my_array, my_array + 1);
- return 0;
- }
- quentin@chrystal ~/tmp $ make align 0
- cc align.c -o align
- align.c:8:1: warning: ‘align’ attribute directive ignored [-Wattributes]
- } __attribute__((align(32)));
- ^
- align.c:11:8: warning: ‘align’ attribute directive ignored [-Wattributes]
- struct foo my_array[42] __attribute__((align(32)));
- ^
- quentin@chrystal ~/tmp $ ./align 0
- sizeof==24, 0x601060 0x601078
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement