---
name: "intro"
section: "3attr"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/intro/3attr"
---

# intro(3attr)

C/C++ attributes

## NAME

intro - C/C++ attributes

## SYNOPSIS

```
[[attr]]
[[vendor::attr]]
```

## DESCRIPTION

Attributes modify the properties of a source construct, such as a type, a variable, or a function.

The standard syntax allows specifying a *vendor* for non-standard attributes.

## VERSIONS

C and C++ dialects have provided various forms of attributes before standardization.

- **\_\_attribute\_\_((***attr***))**

  This is the GNU syntax for attributes. It is supported by both GCC and Clang.

- **\_\_declspec(***attr***)**

  This is the MSVC syntax for attributes. It is supported by Clang.

## STANDARDS

C23, C++23.

## HISTORY

- **\[\[***attr***\]\]** **\[\[***vendor***::***attr***\]\]**

  C23, C++11.

- **\[\[***attr***\]\]** **\[\[gnu::***attr***\]\]**

  gcc 10, g++ 9, clang 9, clang++ 9.

- **\_\_attribute\_\_((***attr***))**

  gcc, g++, clang, clang++.

- **\_\_declspec(***attr***)**

  clang, clang++.
