[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Memory alignment of pointers for sparc64



If I understand correctly, how about `__alignof__', utilizing GCC's
knowledge of the architecture?
  
$ cat a.c
#include <stdio.h>
#ifdef __GNUC__
size_t alignment = __alignof__ (double);
#else
size_t alignment = 8;
#endif
main () { printf ("%d\n", alignment); exit (0); }
$ arch && cc a.c && ./a.out
i586
4

---

$ arch && cc a.c && ./a.out
sparc64
8



Reply to: