aboutsummaryrefslogtreecommitdiffstats
path: root/doc/info
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-10-13 02:01:56 +0200
committerMattias Andrée <maandree@operamail.com>2015-10-13 02:03:37 +0200
commit981a41611c88420b2b9a922d7db217b5216a6b1d (patch)
tree0960b5fb8b7d4b291d127019c1bc16e4410fbc73 /doc/info
parentinfo: non-returning functions (diff)
downloadslibc-981a41611c88420b2b9a922d7db217b5216a6b1d.tar.gz
slibc-981a41611c88420b2b9a922d7db217b5216a6b1d.tar.bz2
slibc-981a41611c88420b2b9a922d7db217b5216a6b1d.tar.xz
info: stdalign.h
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'doc/info')
-rw-r--r--doc/info/chap/language-facilities.texinfo29
1 files changed, 29 insertions, 0 deletions
diff --git a/doc/info/chap/language-facilities.texinfo b/doc/info/chap/language-facilities.texinfo
index c82f104..81908e8 100644
--- a/doc/info/chap/language-facilities.texinfo
+++ b/doc/info/chap/language-facilities.texinfo
@@ -7,6 +7,7 @@
* Alternative tokens:: Alternative spellings of common operators.
* Booleans:: Proper booleans in the C programming language.
* Non-returning functions:: Specifying that functions never return.
+* Variable alignment:: Aligment of variables and data types.
@end menu
@@ -160,3 +161,31 @@ by @code{slibc}. If you want to use both, GCC
supports @code{__attribute__((__noreturn__))} as
a synonym for @code{__attribute__((noreturn))}.
+
+
+@node Variable alignment
+@section Variable alignment
+
+@hfindex stdalign.h
+@cpindex Variable alignment
+@cpindex Alignment, variables
+@cpindex @code{alignas}
+@fnindex @code{alignof}
+@cpindex @code{_Alignas}
+@fnindex @code{_Alignof}
+The @sc{ISO}@tie{}C11 added a variable qualifier
+and a function used to specify the aligned of
+variable, and retrieve the alignment of a type,
+respectively, These are called @code{_Alignas}
+and @code{_Alignof}, by including the header file
+@file{<stdalign.h>}, the macros @code{alignas}
+and @code{alignof}, that alias this keywords, are
+defined.
+
+Declaring a variable with the qualifier
+@code{alignas(TYPE)} specifies that the variable
+should have the alignment of the type @code{TYPE}.
+
+The function call @code{alignof(TYPE)}, returns
+the alignment of the type @code{TYPE}.
+