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:

-Werror

Turn warnings into errors.

-Werror=foo

Turn warning foo into an error.

-Wno-error=foo

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

-Wfoo

Enable warning foo.

-Wno-foo

Suppress warning foo.

-w

Suppress all warnings.

-Weverything

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