2.15. Diagnostic Message Options

Whereas the armcl compiler identifies diagnostics by number, the tiarmclang compiler identifies diagnostics by name. The following table explains how armcl diagnostics are managed via the armcl compiler and how certain diagnostic-related functionality in the armcl compiler might translate into a relevant tiarmclang option.

armcl Option

tiarmclang Option

-version

--version

Both the armcl and tiarmclang compilers support an option to print out version information about the compiler to stdout. The armcl compiler also supports a -version option, which lists the version information associated with each of the executable components in the armcl compiler tools package.

The tiarmclang compiler’s --version option prints the compiler version number and some additional information, including:

  • identity of source branches used to build compiler,

  • the version of the LLVM open source repository that compiler’s source code base is derived from,

  • the target “triple” identifier,

  • the relevant thread model, and

  • the location where the compiler is installed.

armcl Option

tiarmclang Option

--full_compiler_version

--version-string

The armcl compiler supports a hidden option, --full_compiler_version that prints only the version number string itself as opposed to the additional information that is emitted with the -version option.

Likewise, the tiarmclang compiler’s --version-string option emits only a string representation of the compiler version number without the additional information that is emitted when the --version option is specified.

armcl Option (and alias)

tiarmclang Option

--diag_error=<number> (-pdse=<number>)

-Weverything

-Werror=<category>

--diag_remark=<number> (-pdsr=<number>)

-W<category>

--diag_suppress=<number> (-pds=<number>)

-Wno-<category>

--diag_warning=<number> (-pdsw=<number>)

The armcl compiler provides options that allow a diagnostic identified by a specific number (<number>) to be treated as an error, warning, or remark using the --diag_[error|warning|remark] options. You can also suppress a specified diagnostic from being emitted by the compiler using the --diag_suppress option.

The tiarmclang compiler provides several options that are similar to the armcl --diag_[error|remark|warning|suppress] options, but there are subtle differences in functionality:

  • -Weverything - enables all warning diagnostics

  • -Werror=category - indicates that a specific category of warning diagnostics is to be interpreted as errors

  • -Wcategory - enables a specific category of warning diagnostics

  • -Wno-category - disables a specific category of warning diagnostics

armcl Option

tiarmclang Option

--diag_wrap=<on|off>

not supported

The armcl’s --diag_wrap option, which is on by default, tells the compiler to wrap diagnostic messages at 79 columns.

The tiarmclang compiler does not provide this capability.

armcl Option (and alias)

tiarmclang Option

--display_error_number (-pden)

-fdiagnostics-show-option (default)

-fno-diagnostics-show-option

In order to determine the identity of a particular diagnostic, the armcl compiler provides the --display_error_number option. Once the identity of a diagnostic has been determined, you can then specify the number associated with the diagnostic to one of armcl’s diagnostic control options such as --diag_suppress, for example.

Similarly, the tiarmclang compiler enables you to discover the category name associated with a given diagnostic by using the -fdiagnostics-show-option (which is on by default). Once a warning category name has been identified, you can specify the category name as an argument to one of tiarmclang’s diagnostic control options (like -Werror=<category>, for example, which treats warnings that are flagged by the specified <category> as errors).

armcl Option (and alias)

tiarmclang Option

--emit_warnings_as_errors (-pdew)

-Werror[=<category>]

-Wno-error=<category>

The armcl compiler’s option --emit_warnings_as_errors functionally maps to tiarmclang’s -Werror option. The use of this option instructs the compiler to interpret all warning diagnostics as errors.

An optional <category> argument can also be specified with the -Werror option to indicate that only warnings in the specified category should be treated as errors.

The tiarmclang compiler’s -Wno-error=<category> option provides a mechanism by which you can identify a particular category of warning to continue being interpreted as a warning even if the -Werror option is used on the same command-line.

armcl Option (and alias)

tiarmclang Option

--issue_remarks (-pdr)

not supported

The armcl compiler can be made to emit remark diagnostics (non-serious warnings) during a compilation when the --issue_remarks option is specified.

While the tiarmclang compiler does not explicitly support issuing remarks in general, it does provide capability through other options (like the -Rpass option, for example) to enable the compiler to emit remarks related to a specific topic (like optimization transformations that are performed during compilation in the case of -Rpass).

armcl Option (and alias)

tiarmclang Option

--no_warnings (-pdw)

-w

Both the armcl and tiarmclang compilers support an option to disable the reporting of all warning diagnostics. On the armcl compiler, this option is --no_warnings (or pdw). On tiarmclang, it is simply -w. Lower case ‘w’ is essentially the opposite of upper case ‘W’, which enables all diagnostic warnings.)

armcl Option (and alias)

tiarmclang Option

--quiet (-q)

(default)

The armcl compiler emits nominal progress and status information by default when compiling more than one source file during an invocation, but this can be suppressed with armcl’s -q option.

The tiarmclang compiler does not generate progress or status information even while compiling more than one file, so there is no need for a -q option.

armcl Option

tiarmclang Option

--section_sizes=<on|off>

not supported

The armcl compiler reports information about code and constant sections at compile time if the --section-sizes option is turned ‘on’. If the option is not specified on the command-line or if the ‘off’ argument is specified to the option, then this capability is disabled.

The tiarmclang compiler does not provide an analogous option. However, section size information is readily available with the use of binary utilities like tiarmreadelf or tiarmobjdump, which are provided with the tiarmclang tools package.

armcl Option (and alias)

tiarmclang Option

--set_error_limit=<number> (-pdel=<number>)

-ferror-limit=<number>

Both the armcl and tiarmclang compilers provide an option that allows you to indicate the number of errors to be detected / reported before a compilation attempt is aborted. The armcl compiler uses the --set_error_limit option for this purpose. The tiarmclang compiler’s -ferror-limit serves the same purpose.

By default, the armcl compiler abandons compilation after 100 errors are detected / reported. The default error limit for tiarmclang is 20. You can disable the error limit by specifying a <number> of 0 as the option argument.

armcl Option

tiarmclang Option

--verbose

-v

Both armcl and tiarmclang support an option to display verbose progress and status information during the compilation of one or more source files. The tiarmclang compiler’s -v option will emit information about the include file directory search path as well as details about how different executables are invoked during a compilation.

armcl Option (and alias)

tiarmclang Option

--verbose_diagnostics (-pdv)

-fdiagnostics-…

If the --verbose_diagnostics option is specified on the armcl command-line, the compiler provides a more verbose diagnostic message with a given error, warning, or remark if a more verbose message is available.

The tiarmclang compiler can be made to annotate diagnostics with extra information that is gathered by the compiler during a given compilation. For example, tiarmclang’s -fdiagnostics-fixit-info, which is on by default, allows the compiler to annotate diagnostics with information about how to resolve a problem if the fix is known to the compiler.

More details about available -fdiagnostics-… options can be found in the online Clang Compiler User’s Manual.

armcl Option (and alias)

tiarmclang Option

--write_diagnostics_file (-pdf)

not supported

You can redirect the diagnostics reported by the armcl compiler to a file using the --write_diagnostics_file option. The name of the generated diagnostics file will be the name of the source file provided to the compiler with its file extension replaced by an ‘.err’ extension.

The tiarmclang compiler does not provide an analogous option