From: Alejandro Colomar Date: Mon, 23 Jun 2025 01:35:26 +0000 (+0200) Subject: man/man3attr/gnu::aligned.3attr: Add page X-Git-Tag: man-pages-6.15~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=453a8c3586ef3ec04886db5f41b9d0fc1fbddd18;p=thirdparty%2Fman-pages.git man/man3attr/gnu::aligned.3attr: Add page Cc: Aaron Ballman Signed-off-by: Alejandro Colomar --- diff --git a/man/man3attr/gnu::aligned.3attr b/man/man3attr/gnu::aligned.3attr new file mode 100644 index 000000000..1c424dda9 --- /dev/null +++ b/man/man3attr/gnu::aligned.3attr @@ -0,0 +1,51 @@ +.\" Copyright, the authors of the Linux man-pages project +.\" +.\" SPDX-License-Identifier: Linux-man-pages-copyleft +.\" +.TH gnu::aligned 3attr (date) "Linux man-pages (unreleased)" +.SH NAME +gnu::aligned \- set alignment of an object +.SH SYNOPSIS +.nf +.BI [[gnu::aligned( alignment )]] +.B [[gnu::aligned]] +.fi +.SH DESCRIPTION +This attribute can be applied to a type or a variable, +and sets its +.I alignment +in bytes. +.P +If the +.I alignment +is not specified, +the maximum alignment is used. +This is equivalent to +.P +.in +4n +.EX +[[gnu::aligned(alignof(max_align_t))]] +.EE +.in +.SH VERSIONS +.TP +.BI __attribute__((aligned( alignment ))) +.TP +.BI __declspec(align( alignment )) +.P +C11 provides the +.BR _Alignas () +type specifier, +which has similar semantics. +.SH STANDARDS +GNU. +.SH HISTORY +gcc, +g++, +clang 11, +clang++ 2.8.0. +.SH CAVEATS +This attribute can increase the natural alignment of a type, +but it can't decrease it. +.P +The linker may limit the maximum alignment that can be applied.