From 981a41611c88420b2b9a922d7db217b5216a6b1d Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 13 Oct 2015 02:01:56 +0200 Subject: info: stdalign.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- doc/info/chap/language-facilities.texinfo | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'doc/info/chap/language-facilities.texinfo') 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{}, 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}. + -- cgit v1.2.3-70-g09d2