]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
diagnostics::output_spec: fix "color" in "text" output scheme
authorDavid Malcolm <dmalcolm@redhat.com>
Tue, 30 Sep 2025 21:23:32 +0000 (17:23 -0400)
committerDavid Malcolm <dmalcolm@redhat.com>
Tue, 30 Sep 2025 21:23:32 +0000 (17:23 -0400)
The previous refactoring highlighted that we were ignoring the "color"
key within the "text" output scheme for diagnostics.

Fixed thusly.

gcc/ChangeLog:
* diagnostics/output-spec.cc (text_scheme_handler::make_sink): Use
the value of the "color" to determine if the sink's printer is
colorized.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/diagnostics/output-spec.cc

index 29f53771fb7e083cbe9b3d57a0ddd562991fc520..28ea044fcc70c3a9ca3af104691d53be6316b149 100644 (file)
@@ -418,7 +418,7 @@ text_scheme_handler::make_sink (const context &ctxt,
   sink->set_show_nesting (opts.m_show_nesting);
   sink->set_show_locations_in_nesting (opts.m_show_locations_in_nesting);
   sink->set_show_nesting_levels (opts.m_show_levels);
-  // FIXME: what about show_color?
+  pp_show_color (sink->get_printer ()) = opts.m_show_color;
   return sink;
 }