Traditionally, diagnostic messages have been formatted irrespective of the output device's aspect (e.g. its width, ...). You can use the options described below to control the formatting algorithm for diagnostic messages, e.g. how many characters per line, how often source location information should be reported. Note that some language front ends may not honor these options.
-fmessage-length=
n-fdiagnostics-show-location=once
-fdiagnostics-show-location=every-line
-fdiagnostics-color[=
WHEN]
-fno-diagnostics-color
The colors are defined by the environment variable GCC_COLORS. Its value is a colon-separated list of capabilities and Select Graphic Rendition (SGR) substrings. SGR commands are interpreted by the terminal or terminal emulator. (See the section in the documentation of your text terminal for permitted values and their meanings as character attributes.) These substring values are integers in decimal representation and can be concatenated with semicolons. Common values to concatenate include ‘1’ for bold, ‘4’ for underline, ‘5’ for blink, ‘7’ for inverse, ‘39’ for default foreground color, ‘30’ to ‘37’ for foreground colors, ‘90’ to ‘97’ for 16-color mode foreground colors, ‘38;5;0’ to ‘38;5;255’ for 88-color and 256-color modes foreground colors, ‘49’ for default background color, ‘40’ to ‘47’ for background colors, ‘100’ to ‘107’ for 16-color mode background colors, and ‘48;5;0’ to ‘48;5;255’ for 88-color and 256-color modes background colors.
The default GCC_COLORS is
error=01;31:warning=01;35:note=01;36:range1=32:range2=34:locus=01:\ quote=01:fixit-insert=32:fixit-delete=31:\ diff-filename=01:diff-hunk=32:diff-delete=31:diff-insert=32:\ type-diff=01;32
where ‘01;31’ is bold red, ‘01;35’ is bold magenta, ‘01;36’ is bold cyan, ‘32’ is green, ‘34’ is blue, ‘01’ is bold, and ‘31’ is red. Setting GCC_COLORS to the empty string disables colors. Supported capabilities are as follows.
error=
warning=
note=
range1=
range2=
locus=
quote=
fixit-insert=
fixit-delete=
diff-filename=
diff-hunk=
diff-delete=
diff-insert=
type-diff=
-fno-diagnostics-show-option
-fno-diagnostics-show-caret
-fdiagnostics-parseable-fixits
fix-it:"test.c":{45:3-45:21}:"gtk_widget_show_all"
The location is expressed as a half-open range, expressed as a count of bytes, starting at byte 1 for the initial column. In the above example, bytes 3 through 20 of line 45 of “test.c” are to be replaced with the given string:
00000000011111111112222222222 12345678901234567890123456789 gtk_widget_showall (dlg); ^^^^^^^^^^^^^^^^^^ gtk_widget_show_all
The filename and replacement string escape backslash as “\\", tab as “\t”, newline as “\n”, double quotes as “\"”, non-printable characters as octal (e.g. vertical tab as “\013”).
An empty replacement string indicates that the given range is to be removed.
An empty range (e.g. “45:3-45:3”) indicates that the string is to
be inserted at the given position.
-fdiagnostics-generate-patch
--- test.c +++ test.c @ -42,5 +42,5 @ void show_cb(GtkDialog *dlg) { - gtk_widget_showall(dlg); + gtk_widget_show_all(dlg); }
The diff may or may not be colorized, following the same rules
as for diagnostics (see -fdiagnostics-color).
-fdiagnostics-show-template-tree
could not convert 'std::map<int, std::vector<double> >()' from 'map<[...],vector<double>>' to 'map<[...],vector<float>>
the -fdiagnostics-show-template-tree flag enables printing a tree-like structure showing the common and differing parts of the types, such as:
map< [...], vector< [double != float]>>
The parts that differ are highlighted with color (“double” and
“float” in this case).
-fno-elide-type
could not convert 'std::map<int, std::vector<double> >()' from 'map<[...],vector<double>>' to 'map<[...],vector<float>>
Specifying the -fno-elide-type flag suppresses that behavior.
This flag also affects the output of the
-fdiagnostics-show-template-tree flag.
-fno-show-column