ARM Technical Support Knowledge Articles

Can I make the ARM compilation tools report all warnings as errors?

Applies to: DS-5, RealView Development Suite (RVDS)

Answer

For armasm, armcc, armlink, and fromelf, the command-line option --diag_error=<tag> will upgrade a specific warning message (with a number matching <tag>) to an error.

With RVCT 4.0 build 650 and later, you can also use --diag_error=warning, which will cause all warnings to be upgraded to errors.

There are similar options available to make other changes to the severity of diagnostic messages, for example:

Option Description
--diag_suppress=warning All warnings are suppressed
--diag_warning=error All downgradeable errors become warnings

For armclang, the equivalent feature is -W.

-Werror=foo will upgrade the specific warning foo into an error.

Option Description
-W Inhibit all warning messages
-Werror Make all warnings into errors
-Wno-error=foo Leave warning foo as a warning even if -Werror is specified
-Wfoo Enable warning foo
-Wno-foo Disable warning foo

Although it is possible to suppress warning messages, ARM does not recommend that you do so. Warning messages provide valuable diagnostic information for debugging purposes, and you should only suppress them if you have a specific reason to.

Article last edited on: 2016-05-04 21:40:45

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential