3.1 Language extension compatibility: keywords

ARM® Compiler 6 provides support for some keywords that are supported in ARM Compiler 5.

Note

This topic includes descriptions of [COMMUNITY] features. See Support level definitions.
The following table lists some of the commonly used keywords that are supported by ARM Compiler 5 and shows whether ARM Compiler 6 supports them using __attribute__. Replace any instances of these keywords in your code with the recommended alternative where available or use inline assembly instructions.

Note

This is not an exhaustive list of all keywords.

Table 3-1 Keyword language extensions that must be replaced

Keyword supported by ARM Compiler 5 Recommended ARM Compiler 6 alternative
__align(x) __attribute__((aligned(x)))
__alignof__ __alignof__
__ALIGNOF__ __alignof__
__const __attribute__((const))
__forceinline __attribute__((always_inline))
__global_reg Use inline assembler instructions or equivalent routine.
__inline(x) __inline__. The use of this depends on the language mode.
__int64 No equivalent. However, you can use long long. When you use long long in C90 mode, the compiler gives:
  • a warning.
  • an error, if you also use -pedantic-errors.
__INTADDR
[COMMUNITY] None. There is community support for this as a Clang builtin.
__irq __attribute__((interrupt)). This is not supported in AArch64.
__packed __attribute__((packed)). This provides a limited functionality compared to __packed. The __attribute__((packed)) variable attribute applies to members of a structure or union, but it does not apply to variables that are not members of a struct or union.
__pure __attribute__((const))
__smc Use inline assembler instructions or equivalent routine.
__softfp __attribute__((pcs("aapcs")))
__svc Use inline assembler instructions or equivalent routine.
__svc_indirect Use inline assembler instructions or equivalent routine.
__svc_indirect_r7 Use inline assembler instructions or equivalent routine.
__thread __thread
__value_in_regs __attribute__((value_in_regs))
__weak __attribute__((weak))
__writeonly No equivalent.

Note

The __const keyword was supported by older versions of armcc. The equivalent for this keyword in ARM Compiler 5 and ARM Compiler 6 is __attribute__((const)).
Related reference
3.6 C and C++ implementation compatibility
3.2 Language extension compatibility: attributes
3.3 Language extension compatibility: pragmas
Non-ConfidentialPDF file icon PDF versionARM DUI0742F
Copyright © 2014-2016 ARM. All rights reserved.