# Attributes

Attributes are a way to provide additional information about a declaration to the compiler. The C+11 attribute syntax is consistent with the C2x standard.

## Use Attributes

The compiler supports three ways to add attributes to your program:

- Gnu Syntax

      __attribute__((attribute_name(arguments)))

- Microsoft Syntax

      __declspec(attribute_name(argument))

- C++11 Standardized Attribute Syntax (part of the C++11 language standard)

      [[attribute_name(arguments)]]

      [[attribute-namespace :: attribute_name(arguments)]]

Some attributes are available for both Intel® microprocessors and non-Intel microprocessors but they may perform additional optimizations for Intel® microprocessors than they perform for non-Intel microprocessors. Refer to the individual attribute name for a detailed description.

Parent topic: Compiler Reference

- align
  Directs the compiler to align the variable to a specified boundary and a specified offset.
- align_value
  Provides the ability to add a pointer alignment value to a pointer typedef declaration.
- avoid_false_share
  Provides the ability to pad and/or align the defined variable such that it will not be subject to false cache line sharing with any other variable.
- code_align
  Specifies the byte alignment for a routine.
- concurrency_safe
  Guides the compiler to parallelize more loops and straight-line code.
- const
  Indicates that a function has no effect other than returning a value and that it uses only its arguments to generate that return value.
- cpu_dispatch, cpu_specific
  Provides the ability to write one or more versions of a function that execute only on a list of targeted processors (cpu_dispatch). Provides the ability to declare that a version of a function is targeted at particular types of processors (cpu_specific).
- mpx
  Directs the compiler to pass Intel® Memory Protection Extensions (Intel® MPX) bounds information along with any pointer-typed parameters.
- target
  Specifies a target for called functions or variables.
- vector
  Provides the ability to vectorize user-defined functions and loops.
- vector_variant
  Specifies a vector variant function that corresponds to its original C/C++ scalar function. This vector variant function can be invoked under vector context at call sites.