CXDiagnosticDisplayOptions

Options to control the display of diagnostics.

The values in this enum are meant to be combined to customize the behavior of \c clang_formatDiagnostic().

Values

ValueMeaning
displaySourceLocation0x01

Display the source-location information where the diagnostic was located.

When set, diagnostics will be prefixed by the file, line, and (optionally) column to which the diagnostic refers. For example,

\code test.c:28: warning: extra tokens at end of #endif directive \endcode

This option corresponds to the clang flag \c -fshow-source-location.

displayColumn0x02

If displaying the source-location information of the diagnostic, also include the column number.

This option corresponds to the clang flag \c -fshow-column.

displaySourceRanges0x04

If displaying the source-location information of the diagnostic, also include information about source ranges in a machine-parsable format.

This option corresponds to the clang flag \c -fdiagnostics-print-source-range-info.

displayOption0x08

Display the option name associated with this diagnostic, if any.

The option name displayed (e.g., -Wconversion) will be placed in brackets after the diagnostic text. This option corresponds to the clang flag \c -fdiagnostics-show-option.

displayCategoryId0x10

Display the category number associated with this diagnostic, if any.

The category number is displayed within brackets after the diagnostic text. This option corresponds to the clang flag \c -fdiagnostics-show-category=id.

displayCategoryName0x20

Display the category name associated with this diagnostic, if any.

The category name is displayed within brackets after the diagnostic text. This option corresponds to the clang flag \c -fdiagnostics-show-category=name.

Meta