File: intro.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 (49 lines) | stat: -rw-r--r-- 1,049 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
.\" Copyright, the authors of the Linux man-pages project
.\"
.\" SPDX-License-Identifier: Linux-man-pages-copyleft
.\"
.TH intro 3attr 2025-06-28 "Linux man-pages (unreleased)"
.SH NAME
intro \- C/C++ attributes
.SH SYNOPSIS
.nf
.BI [[ attr ]]
.BI [[ vendor :: attr ]]
.fi
.SH DESCRIPTION
Attributes modify the properties of a source construct,
such as a type, a variable, or a function.
.P
The standard syntax allows specifying a
.I vendor
for non-standard attributes.
.SH VERSIONS
C and C++ dialects have provided various forms of attributes
before standardization.
.TP
.BI __attribute__(( attr ))
This is the GNU syntax for attributes.
It is supported by both GCC and Clang.
.TP
.BI __declspec( attr )
This is the MSVC syntax for attributes.
It is supported by Clang.
.SH STANDARDS
C23, C++23.
.SH HISTORY
.TP
.BI [[ attr ]]
.TQ
.BI [[ vendor :: attr ]]
C23, C++11.
.TP
.BI [[ attr ]]
.TQ
.BI [[gnu:: attr ]]
gcc 10, g++ 9, clang 9, clang++ 9.
.TP
.BI __attribute__(( attr ))
gcc, g++, clang, clang++.
.TP
.BI __declspec( attr )
clang, clang++.