2.3 Pragmas for controlling diagnostics with armclang

Pragmas within your source code can control the output of diagnostics from the armclang compiler.

See Controlling Errors and Warnings in the Clang Compiler User's Manual for full details about controlling diagnostics with armclang.

The following are some of the common options that control diagnostics:

#pragma clang diagnostic ignored "-Wname"

Ignores the diagnostic message specified by name.

#pragma clang diagnostic warning "-Wname"

Sets the diagnostic message specified by name to warning severity.

#pragma clang diagnostic error "-Wname"

Sets the diagnostic message specified by name to error severity.

#pragma clang diagnostic fatal "-Wname"

Sets the diagnostic message specified by name to fatal error severity.

#pragma clang diagnostic push

Saves the diagnostic state so that it can be restored.

#pragma clang diagnostic pop

Restores the last saved diagnostic state.

The compiler provides appropriate diagnostic names in the diagnostic output.


Alternatively, you can use the command-line option, -Wname, to suppress or change the severity of messages, but the change applies for the entire compilation.

Non-ConfidentialPDF file icon PDF versionDUI0773J
Copyright © 2014–2017, 2019 Arm Limited or its affiliates. All rights reserved.