4.15 Pragmas recognized by the compiler

The compiler recognizes a number of pragmas, used to instruct the compiler to use particular features.

The compiler recognizes the following pragmas:

Pragmas for saving and restoring the pragma state

  • #pragma pop
  • #pragma push

Pragmas controlling optimization goals

  • #pragma Onum
  • #pragma Ospace
  • #pragma Otime

Pragmas controlling code generation

  • #pragma arm
  • #pragma thumb
  • #pragma exceptions_unwind, #pragma no_exceptions_unwind

Pragmas controlling loop unrolling

  • #pragma unroll [(n)]
  • #pragma unroll_completely

Pragmas controlling Precompiled Header (PCH) processing

  • #pragma hdrstop
  • #pragma no_pch

Pragmas controlling anonymous structures and unions

  • #pragma anon_unions, #pragma no_anon_unions

Pragmas controlling diagnostic messages

  • #pragma diag_default tag[,tag,...]
  • #pragma diag_error tag[,tag,...]
  • #pragma diag_remark tag[,tag,...]
  • #pragma diag_suppress tag[,tag,...]
  • #pragma diag_warning tag[, tag, ...]

Miscellaneous pragmas

  • #pragma arm section [section_type_list]
  • #pragma import(__use_full_stdio)
  • #pragma inline, #pragma no_inline
  • #pragma once
  • #pragma pack(n)
  • #pragma softfp_linkage, #pragma no_softfp_linkage
  • #pragma import symbol_name
Non-ConfidentialPDF file icon PDF versionARM DUI0472M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.