Bump to 1.14.1
[platform/upstream/augeas.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 @item
21 The @code{alignof} and @code{_Alignof} macros return too large values for
22 the types @code{double} and @code{long long} in GCC 4.7.0.
23 @end itemize
24
25 Portability problems not fixed by Gnulib:
26 @itemize
27 @item
28 In ISO C11, the operand of @code{alignof}/@code{_Alignof} must be a
29 parenthesized type.  Recent versions of GCC support an extension in
30 which the operand can also be a unary expression, as with
31 @code{sizeof}.  The Gnulib substitute does not support this extension.
32 @item
33 On most pre-C11 platforms, the operand of
34 @code{alignof}/@code{_Alignof} cannot be a structure type containing a
35 flexible array member.
36 @item
37 @code{_Alignas} and @code{alignas} are not always supported;
38 on platforms lacking support, the
39 macro @code{__alignas_is_defined} is not defined.
40 Supported compilers include GCC, IBM C, Sun C 5.9 and later,
41 and MSVC 7.0 and later.
42 @item
43 Some compilers do not support alignment via
44 @code{alignas}/@code{_Alignas} of @code{auto} variables (i.e.,
45 variables on the stack).  They diagnose and ignore the alignment: Sun
46 C 5.11.
47 @item
48 Some linkers do not support operands of @code{_Alignas}/@code{alignas}
49 that are greater than 8: mingw.
50 @item
51 Some compilers require the operand of @code{_Alignas}/@code{alignas}
52 to be a single integer constant, not an expression: MSVC 7.0 through
53 at least 10.0.
54 @item
55 The Sun C 5.11 compiler sometimes mishandles the alignment of multiple
56 external variables that are declared close together with
57 @code{_Alignas}/@code{alignas}.  This compiler bug causes the Gnulib
58 module @code{stdalign-tests} to fail.  The Sun Studio Developer Bug
59 Report Review Team assigned the internal review ID 2125432 (dated
60 2011-11-01) to this issue.
61 @item
62 @code{<stdalign.h>} must be #included before @code{_Alignas} and
63 @code{_Alignof} can be used.
64 @item
65 You cannot assume that @code{_Alignas} and @code{_Alignof} are reserved words;
66 they might be macros.
67 @end itemize