3.2 Language extension compatibility: attributes

ARM® Compiler 6 provides support for some function, variable, and type attributes that were supported in ARM Compiler 5. Other attributes are not supported.

The following attributes are supported by ARM Compiler 5 and ARM Compiler 6. These attributes do not require modification in your code:
  • __attribute__((aligned(x)))
  • __attribute__((always_inline))
  • __attribute__((const))
  • __attribute__((deprecated))
  • __attribute__((noinline))
  • __declspec(noinline)
  • __attribute__((nonnull))
  • __attribute__((noreturn))
  • __declspec(noreturn)
  • __attribute__((nothrow))
  • __declspec(nothrow)
  • __attribute__((pcs("calling convention")))
  • __attribute__((pure))
  • __attribute__((section("name")))

    Note

    Older compiler versions supported the zero_init attribute. ARM Compiler 6 does not support the zero_init attribute, but if the section name starts with .bss., the variable is placed in a ZI section.
  • __attribute__((unused))
  • __attribute__((used))
  • __attribute__((visibility))
  • __attribute__((weak))
  • __attribute__((weakref))
Though ARM Compiler 6 supports certain __declspec attributes, ARM recommends using __attribute__ where available.

Table 3-2 Support for __declspec attributes

declspec supported by ARM Compiler 5 Recommended ARM Compiler 6 alternative
__declspec(dllimport) None. There is no support for BPABI linking models.
__declspec(dllexport) None. There is no support for BPABI linking models.
__declspec(noinline) __attribute__((noinline))
__declspec(noreturn) __attribute__((noreturn))
__declspec(nothrow) __attribute__((nothrow))
__declspec(notshared) None. There is no support for BPABI linking models.
__declspec(thread) __thread
Related reference
3.6 C and C++ implementation compatibility
3.1 Language extension compatibility: keywords
3.3 Language extension compatibility: pragmas
Non-ConfidentialPDF file icon PDF versionARM DUI0742F
Copyright © 2014-2016 ARM. All rights reserved.