From: Joel Rosdahl Date: Wed, 19 Nov 2014 20:23:20 +0000 (+0100) Subject: Pass -fdiagnostics-color=auto to the compiler even if stderr is redirected X-Git-Tag: v3.2.1~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b766d4a73d1041f3206194d8caba91a90cb2a3b2;p=thirdparty%2Fccache.git Pass -fdiagnostics-color=auto to the compiler even if stderr is redirected This fixes a problem when e.g. a configure test probes if the compiler (wrapped via ccache) supports -fdiagnostics-color=auto. If ccache discards the option since configure redirects stderr, then configure will erroneously think that the compiler supports the option and the build will fail later on (if stderr refers to a TTY). --- diff --git a/ccache.c b/ccache.c index f3a6a0383..9e2f4d81f 100644 --- a/ccache.c +++ b/ccache.c @@ -1999,6 +1999,8 @@ cc_process_args(struct args *args, struct args **preprocessor_args, /* Output is redirected, so color output must be forced. */ args_add(stripped_args, "-fdiagnostics-color=always"); cc_log("Automatically forcing colors"); + } else { + args_add(stripped_args, argv[i]); } found_color_diagnostics = true; continue;