Query: __alignof__
OS: netbsd
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
__ALIGNOF__(3) BSD Library Functions Manual __ALIGNOF__(3)NAME__alignof__ -- GNU extension for alignment of an objectSYNOPSISint __alignof__(void x);DESCRIPTIONThe __alignof__() operator returns the alignment of its operand. The operand can be a type or an expression. If the operand is a 'lvalue', the return value represents the required alignment of the underlying type, not the actual alignment of the specified 'lvalue'. 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.EXAMPLESThe syntax is comparable to the sizeof() operator. If the architecture aligns integers along 32-bit address boundaries, the following should print the value 4. (void)printf("%d ", __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 ", __alignof__(a.y));SEE ALSOgcc(1), attribute(3), offsetof(3), typeof(3)CAVEATSThis is a non-standard, compiler-specific extension.BSDDecember 20, 2010 BSD
Related Man Pages |
---|
__cacheline_aligned(3) - netbsd |
__constfunc(3) - netbsd |
__dead(3) - netbsd |
__predict_false(3) - netbsd |
__section(3) - netbsd |