Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <stdint.h>
- #define ODP_ALIGN __attribute__ ((aligned (512)))
- typedef struct {
- uint32_t testv;
- uint32_t testv1;
- uint16_t testv4;
- } test_t ODP_ALIGN;
- typedef struct {
- uint32_t testv;
- uint32_t testv1;
- uint16_t testv4;
- } ODP_ALIGN test2_t;
- int main(void)
- {
- test_t unaligned;
- //test_t unaligned2[3];
- test2_t aligned[5];
- int i;
- printf("test_t size %lu\n", sizeof(unaligned));
- printf("test_t align %lu\n", _Alignof(unaligned));
- printf("test2_t size %lu\n", sizeof(aligned[0]));
- printf("test2_t align %lu\n", _Alignof(aligned));
- return 0;
- }
- ~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement