aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.8/gcc/toplev.c
diff options
context:
space:
mode:
authorsynergydev <synergye@codefi.re>2013-08-08 04:40:50 -0700
committersynergydev <synergye@codefi.re>2013-08-08 15:04:43 -0700
commitb418cc876926be9532aa8ea868186aa92ed462a0 (patch)
tree6157be055e3b838af0c65f9b95824580b5ddc7e7 /gcc-4.8/gcc/toplev.c
parent34cef20a1108ff399ecbe13f42e1f6bc8c909b27 (diff)
downloadtoolchain_gcc-b418cc876926be9532aa8ea868186aa92ed462a0.tar.gz
toolchain_gcc-b418cc876926be9532aa8ea868186aa92ed462a0.tar.bz2
toolchain_gcc-b418cc876926be9532aa8ea868186aa92ed462a0.zip
[4.8] Backport diagnostic color support from trunk
Squashed commit of r197841, r197842, and r198332 from trunk. This is capable of coloring errors, warnings, notes, carets, locus', and/or quotes. Documentation for this feature may be found here: http://gcc.gnu.org/onlinedocs/gcc/Language-Independent-Options.html Change-Id: I14f2f852562d18fcef807583635e4e2ceee64829
Diffstat (limited to 'gcc-4.8/gcc/toplev.c')
-rw-r--r--gcc-4.8/gcc/toplev.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc-4.8/gcc/toplev.c b/gcc-4.8/gcc/toplev.c
index 7bced0446..be814375e 100644
--- a/gcc-4.8/gcc/toplev.c
+++ b/gcc-4.8/gcc/toplev.c
@@ -74,6 +74,7 @@ along with GCC; see the file COPYING3. If not see
#include "gimple.h"
#include "tree-ssa-alias.h"
#include "plugin.h"
+#include "diagnostic-color.h"
#if defined(DBX_DEBUGGING_INFO) || defined(XCOFF_DEBUGGING_INFO)
#include "dbxout.h"
@@ -1209,6 +1210,13 @@ process_options (void)
maximum_field_alignment = initial_max_fld_align * BITS_PER_UNIT;
+ /* Default to -fdiagnostics-color=auto if GCC_COLORS is in the environment,
+ otherwise default to -fdiagnostics-color=never. */
+ if (!global_options_set.x_flag_diagnostics_show_color
+ && getenv ("GCC_COLORS"))
+ pp_show_color (global_dc->printer)
+ = colorize_init (DIAGNOSTICS_COLOR_AUTO);
+
/* Allow the front end to perform consistency checks and do further
initialization based on the command line options. This hook also
sets the original filename if appropriate (e.g. foo.i -> foo.c)