File: gnu%3A%3Aaligned.3attr

package info (click to toggle)
manpages 6.15-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 20,184 kB
  • sloc: sh: 575; python: 222; perl: 190; makefile: 29; lisp: 22
file content (51 lines) | stat: -rw-r--r-- 986 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
.\" Copyright, the authors of the Linux man-pages project
.\"
.\" SPDX-License-Identifier: Linux-man-pages-copyleft
.\"
.TH gnu::aligned 3attr 2025-06-28 "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.