doc: Update for Solaris 11 2011-11.
[gnulib.git] / doc / posix-headers / stdalign.texi
1 @node stdalign.h
2 @section @file{stdalign.h}
3
4 POSIX specification:@* Not in POSIX yet, but we expect it will be.
5 ISO C11 (latest free draft
6 @url{http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1570.pdf})
7 sections 6.5.3.4, 6.7.5, 7.15.
8 C++11 (latest free draft
9 @url{http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3242.pdf})
10 section 18.10.
11
12 Gnulib module: stdalign
13
14 Portability problems fixed by Gnulib:
15 @itemize
16 @item
17 This header file is missing on most circa-2011 platforms.
18 @item
19 Clang 3.0's @code{<stdalign.h>} does not define @code{alignof}/@code{_Alignof}.
20 @end itemize
21
22 Portability problems not fixed by Gnulib:
23 @itemize
24 @item
25 @code{_Alignas} and @code{alignas} are not always supported;
26 on platforms lacking support, the
27 macro @code{__alignas_is_defined} is not defined.
28 Supported compilers include GCC, IBM C, Sun C 5.11 and later,
29 and MSVC 7.0 and later.
30 @item
31 Some compilers do not support alignment via
32 @code{alignas}/@code{_Alignas} of @code{auto} variables (i.e.,
33 variables on the stack).  They diagnose and ignore the alignment: Sun
34 C 5.11.
35 @item
36 Some linkers do not support operands of @code{_Alignas}/@code{alignas}
37 that are greater than 8: mingw.
38 @item
39 Some compilers require the operand of @code{_Alignas}/@code{alignas}
40 to be a single integer constant, not an expression: MSVC 7.0 through
41 at least 10.0.
42 @item
43 The Sun C 5.11 compiler sometimes mishandles the alignment of multiple
44 external variables that are declared close together with
45 @code{_Alignas}/@code{alignas}.  This compiler bug causes the Gnulib
46 module @code{stdalign-tests} to fail.  The Sun Studio Developer Bug
47 Report Review Team assigned the internal review ID 2125432 (dated
48 2011-11-01) to this issue.
49 @item
50 @code{<stdalign.h>} must be #included before @samp{_Alignas} and
51 @samp{_Alignof} can be used.
52 @item
53 You cannot assume that @code{_Alignas} and @code{_Alignof} are reserved words;
54 they might be macros.
55 @end itemize