01c6d18
2013-09-20  Jakub Jelinek  <jakub@redhat.com>
01c6d18
01c6d18
	* common.opt (-fdiagnostics-color=): Default to auto.
01c6d18
	* toplev.c (process_options): Always default to
01c6d18
	-fdiagnostics-color=auto if no -f{,no-}diagnostics-color*.
01c6d18
	* doc/invoke.texi (-fdiagnostics-color*): Adjust documentation
01c6d18
	of the default.
01c6d18
01c6d18
--- gcc/common.opt.jj	2013-09-18 12:06:53.000000000 +0200
01c6d18
+++ gcc/common.opt	2013-09-20 10:00:00.935823900 +0200
01c6d18
@@ -1037,7 +1037,7 @@ Common Alias(fdiagnostics-color=,always,
01c6d18
 ;
01c6d18
 
01c6d18
 fdiagnostics-color=
01c6d18
-Common Joined RejectNegative Var(flag_diagnostics_show_color) Enum(diagnostic_color_rule) Init(DIAGNOSTICS_COLOR_NO)
01c6d18
+Common Joined RejectNegative Var(flag_diagnostics_show_color) Enum(diagnostic_color_rule) Init(DIAGNOSTICS_COLOR_AUTO)
01c6d18
 -fdiagnostics-color=[never|always|auto]	Colorize diagnostics
01c6d18
 
01c6d18
 ; Required for these enum values.
01c6d18
--- gcc/toplev.c.jj	2013-09-09 11:32:39.000000000 +0200
01c6d18
+++ gcc/toplev.c	2013-09-20 10:10:08.198721005 +0200
01c6d18
@@ -1229,10 +1229,8 @@ process_options (void)
01c6d18
 
01c6d18
   maximum_field_alignment = initial_max_fld_align * BITS_PER_UNIT;
01c6d18
 
01c6d18
-  /* Default to -fdiagnostics-color=auto if GCC_COLORS is in the environment,
01c6d18
-     otherwise default to -fdiagnostics-color=never.  */
01c6d18
-  if (!global_options_set.x_flag_diagnostics_show_color
01c6d18
-      && getenv ("GCC_COLORS"))
01c6d18
+  /* Default to -fdiagnostics-color=auto.  */
01c6d18
+  if (!global_options_set.x_flag_diagnostics_show_color)
01c6d18
     pp_show_color (global_dc->printer)
01c6d18
       = colorize_init (DIAGNOSTICS_COLOR_AUTO);
01c6d18
 
01c6d18
--- gcc/doc/invoke.texi.jj	2013-09-18 12:06:50.000000000 +0200
01c6d18
+++ gcc/doc/invoke.texi	2013-09-20 10:09:29.079904455 +0200
01c6d18
@@ -3046,8 +3046,7 @@ a message which is too long to fit on a
01c6d18
 @cindex highlight, color, colour
01c6d18
 @vindex GCC_COLORS @r{environment variable}
01c6d18
 Use color in diagnostics.  @var{WHEN} is @samp{never}, @samp{always},
01c6d18
-or @samp{auto}.  The default is @samp{never} if @env{GCC_COLORS} environment
01c6d18
-variable isn't present in the environment, and @samp{auto} otherwise.
01c6d18
+or @samp{auto}.  The default is @samp{auto}.
01c6d18
 @samp{auto} means to use color only when the standard error is a terminal.
01c6d18
 The forms @option{-fdiagnostics-color} and @option{-fno-diagnostics-color} are
01c6d18
 aliases for @option{-fdiagnostics-color=always} and