3.25 Variable attributes

The __attribute__ keyword enables you to specify special attributes of variables or structure fields, functions, and types.

The keyword format is either of the following:
__attribute__((attribute1, attribute2, ...))
__attribute__((__attribute1__, __attribute2__, ...))
For example:
static int b __attribute__((__unused__));
The available variable attributes are as follows:
  • __attribute__((alias))
  • __attribute__((aligned))
  • __attribute__((deprecated))
  • __attribute__((packed))
  • __attribute__((section("name")))
  • __attribute__((unused))
  • __attribute__((used))
  • __attribute__((weak))
  • __attribute__((weakref("target")))
Related reference
3.26 __attribute__((alias)) variable attribute
3.27 __attribute__((aligned)) variable attribute
3.28 __attribute__((deprecated)) variable attribute
3.29 __attribute__((packed)) variable attribute
3.30 __attribute__((section("name"))) variable attribute
3.32 __attribute__((unused)) variable attribute
3.31 __attribute__((used)) variable attribute
3.33 __attribute__((weak)) variable attribute
3.34 __attribute__((weakref("target"))) variable attribute
Non-ConfidentialPDF file icon PDF versionARM DUI0774E
Copyright © 2014-2016 ARM. All rights reserved.