You copied the Doc URL to your clipboard.

Options for controlling diagnostics with armclang

A number of options control the output of diagnostics with 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:


Turn warnings into errors.


Turn warning foo into an error.


Leave warning foo as a warning even if -Werror is specified.


Enable warning foo.


Suppress warning foo.


Suppress all warnings.


Enable all warnings.

Where a message can be suppressed, the compiler provides the appropriate suppression flag in the diagnostic output.

For example, by default armclang checks the format of printf() statements to ensure that the number of % format specifiers matches the number of data arguments. The following code generates a warning:

printf("Result of %d plus %d is %d\n", a, b);
armclang --target=aarch64-arm-none-eabi -c hello.c 
hello.c:25:36: warning: more '%' conversions than data arguments [-Wformat]
  printf("Result of %d plus %d is %d\n", a, b);

To suppress this warning, use -Wno-format:

armclang --target=aarch64-arm-none-eabi -c hello.c -Wno-format
Was this page helpful? Yes No