]> git.ipfire.org Git - thirdparty/man-pages.git/commitdiff
man/man3attr/gnu::aligned.3attr: Add page
authorAlejandro Colomar <alx@kernel.org>
Mon, 23 Jun 2025 01:35:26 +0000 (03:35 +0200)
committerAlejandro Colomar <alx@kernel.org>
Sat, 28 Jun 2025 14:51:43 +0000 (16:51 +0200)
Cc: Aaron Ballman <aaron@aaronballman.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
man/man3attr/gnu::aligned.3attr [new file with mode: 0644]

diff --git a/man/man3attr/gnu::aligned.3attr b/man/man3attr/gnu::aligned.3attr
new file mode 100644 (file)
index 0000000..1c424dd
--- /dev/null
@@ -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.