__ALIGNOF__(3) | Library Functions Manual | __ALIGNOF__(3) |
The returned value is specific to the architecture and the ABI. If the architecture does not impose strict alignment requirements, __alignof__() returns the minimum required alignment. If __aligned(3) is used to increase the alignment, __alignof__() returns the specified alignment.
(void)printf("%d\n", __alignof__(int));
On the other hand, the following example should print the value 1, even though this is unlikely to be the actual alignment of the structure member.
struct align { int x; char y; } a; (void)printf("%d\n", __alignof__(a.y));
December 20, 2010 | NetBSD 6.1 |