Not in POSIX yet, but we expect it will be. ISO C11 (latest free draft http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf) sections 126.96.36.199, 6.7.5, 7.15. C++11 (latest free draft http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf) section 18.10.
Gnulib module: stdalign
Portability problems fixed by Gnulib:
<stdalign.h>does not define
_Alignofmacros return too large values for the types
long longin GCC 4.7.0.
Portability problems not fixed by Gnulib:
_Alignofmust be a parenthesized type. Recent versions of GCC support an extension in which the operand can also be a unary expression, as with
sizeof. The Gnulib substitute does not support this extension.
_Alignofcannot be a structure type containing a flexible array member.
alignasare not always supported; on platforms lacking support, the macro
__alignas_is_definedis not defined. Supported compilers include GCC, IBM C, Sun C 5.9 and later, and MSVC 7.0 and later.
autovariables (i.e., variables on the stack). They diagnose and ignore the alignment: Sun C 5.11.
alignasthat are greater than 8: mingw.
alignasto be a single integer constant, not an expression: MSVC 7.0 through at least 10.0.
alignas. The Sun Studio Developer Bug Report Review Team assigned the internal review ID 2125432 (dated 2011-11-01) to this issue. The bug appears to be fixed in Sun C 5.15, also known as Oracle Developer Studio 12.6.
<stdalign.h>must be #included before
_Alignofcan be used.
_Alignofare reserved words; they might be macros.