aboutsummaryrefslogtreecommitdiffstats
diff options
authorAlejandro Colomar <alx@kernel.org>2025-06-23 03:35:26 +0200
committerAlejandro Colomar <alx@kernel.org>2025-06-28 16:51:43 +0200
commit453a8c3586ef3ec04886db5f41b9d0fc1fbddd18 (patch)
tree8bb940515fc9f2c78fa078b718b9bbeda190b0dc
parent4445a5dacb3b52c1ed2c735dd2908dbcd5f87505 (diff)
downloadman-pages-453a8c3586ef3ec04886db5f41b9d0fc1fbddd18.tar.gz
man/man3attr/gnu::aligned.3attr: Add page
Cc: Aaron Ballman <aaron@aaronballman.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
-rw-r--r--man/man3attr/gnu::aligned.3attr51
1 files changed, 51 insertions, 0 deletions
diff --git a/man/man3attr/gnu::aligned.3attr b/man/man3attr/gnu::aligned.3attr
new file mode 100644
index 0000000000..1c424dda9b
--- /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.