3.14. Diagnostic Message Options

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

cl2000 Option

c29clang Option

--compiler_revision

--version-string

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

Likewise, the c29clang 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.

cl2000 Option

c29clang Option

--tool_version (-version)

--version

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

The c29clang 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.

cl2000 Option (and alias)

c29clang 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 cl2000 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 c29clang compiler provides several options that are similar to the cl2000 --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

cl2000 Option

c29clang Option

--diag_wrap=<on|off>

not supported

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

The c29clang compiler does not provide this capability.

cl2000 Option (and alias)

c29clang Option

--display_error_number (-pden)

-fdiagnostics-show-option (default)

-fno-diagnostics-show-option

In order to determine the identity of a particular diagnostic, the cl2000 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 cl2000’s diagnostic control options such as --diag_suppress, for example.

Similarly, the c29clang 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 c29clang’s diagnostic control options (like -Werror=<category>, for example, which treats warnings that are flagged by the specified <category> as errors).

cl2000 Option (and alias)

c29clang Option

--emit_warnings_as_errors (-pdew)

-Werror[=<category>]

-Wno-error=<category>

The cl2000 compiler’s option --emit_warnings_as_errors functionally maps to c29clang’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 c29clang 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.

cl2000 Option

c29clang Option

--flash_prefetch_warn

not supported

The cl2000 compiler provides the --flash_prefetch_warn to display warnings about a specific sequence of instructions that may cause a prefetch buffer overflow. This case does not apply to C29x devices.

The c29clang compiler does not provide an analogous option.

cl2000 Option (and alias)

c29clang Option

--issue_remarks (-pdr)

not supported

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

While the c29clang 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).

cl2000 Option (and alias)

c29clang Option

--no_warnings (-pdw)

-w

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

cl2000 Option (and alias)

c29clang Option

--quiet (-q)

(default)

The cl2000 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 cl2000’s -q option.

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

cl2000 Option (and alias)

c29clang Option

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

-ferror-limit=<number>

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

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

cl2000 Option

c29clang Option

--super_quiet (-q)

No supported exactly

The cl2000 –super_quiet option disables non-diagnostic output, but allows remarks, errors, and warnings.

You may decide to migrate this option to the clang c29clang -w option, which disables non-diagnostic output but also suppresses all warnings. Note that the two options are not equivalent for this reason.

cl2000 Option

c29clang Option

--verbose

-v

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

cl2000 Option (and alias)

c29clang Option

--verbose_diagnostics (-pdv)

-fdiagnostics-…

If the --verbose_diagnostics option is specified on the cl2000 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 c29clang compiler can be made to annotate diagnostics with extra information that is gathered by the compiler during a given compilation. For example, c29clang’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.

cl2000 Option (and alias)

c29clang Option

--write_diagnostics_file (-pdf)

not supported

You can redirect the diagnostics reported by the cl2000 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 c29clang compiler does not provide an analogous option.