Keil Logo

Diagnostics for pragma compatibility

4.5 Diagnostics for pragma compatibility

Older armcc compiler versions supported many pragmas which are not supported by armclang, but which could change the semantics of code. When armclang encounters these pragmas, it generates diagnostic messages.

The following table shows which diagnostics are generated for each pragma type, and the diagnostic group to which that diagnostic belongs. armclang generates diagnostics as follows:

  • Errors indicate use of an armcc pragma which could change the semantics of code.
  • Warnings indicate use of any other armcc pragma which is ignored by armclang.
  • Pragmas other than those listed are silently ignored.

Table 4-7 Pragma diagnostics

Pragma supported by older compiler versions Default diagnostic type Diagnostic group
#pragma anon_unions Warning armcc-pragma-anon-unions
#pragma no_anon_unions Warning armcc-pragma-anon-unions
#pragma arm Error armcc-pragma-arm
#pragma arm section [section_type_list] Error armcc-pragma-arm
#pragma diag_default tag[,tag,...] Error armcc-pragma-diag
#pragma diag_error tag[,tag,...] Error armcc-pragma-diag
#pragma diag_remark tag[,tag,...] Warning armcc-pragma-diag
#pragma diag_suppress tag[,tag,...] Warning armcc-pragma-diag
#pragma diag_warning tag[,tag,...] Warning armcc-pragma-diag
#pragma exceptions_unwind Error armcc-pragma-exceptions-unwind
#pragma no_exceptions_unwind Error armcc-pragma-exceptions-unwind
#pragma GCC system_header None -
#pragma hdrstop Warning armcc-pragma-hdrstop
#pragma import symbol_name Error armcc-pragma-import
#pragma inline Warning armcc-pragma-inline
#pragma no_inline Warning armcc-pragma-inline
#pragma no_pch Warning armcc-pragma-no-pch
#pragma Onum Warning armcc-pragma-optimization
#pragma once None -
#pragma Ospace Warning armcc-pragma-optimization
#pragma Otime Warning armcc-pragma-optimization
#pragma pack None -
#pragma pop Error armcc-pragma-push-pop
#pragma push Error armcc-pragma-push-pop
#pragma softfp_linkage Error armcc-pragma-softfp-linkage
#pragma no_softfp_linkage Error armcc-pragma-softfp-linkage
#pragma thumb Error armcc-pragma-thumb
#pragma weak symbol None -
#pragma weak symbol1 = symbol2 None -

In addition to the above diagnostic groups, there are the following additional diagnostic groups:

Contains all of the above diagnostic groups.
Contains diagnostics about pragmas which are not known to armclang, and are not in the above table.
Contains all pragma-related diagnostics, including armcc-pragmas and unknown-pragmas.

Any non-fatal armclang diagnostic group can be ignored, upgraded, or downgraded using the following command-line options:

Suppress a group of diagnostics:
Upgrade a group of diagnostics to warnings:
Upgrade a group of diagnostics to errors:
Downgrade a group of diagnostics to warnings:
Non-ConfidentialPDF file icon PDF version100068_0614_00_en
Copyright © 2014–2020 Arm Limited or its affiliates. All rights reserved. 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.