Is gcc -fdiagnostics-colour working on Windows?

Viewed 2388

I am using Windows 7, and in both the mintty (Cygwin) and Windows Command Prompt terminals, I don't get any colour for MinGW GCC error messages.

$ printenv GCC_COLORS
error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01
$ gcc -c -fdiagnostics-color=always file.cpp -o file.o

For both terminals, I can see colour when I use git commands, so the terminals are fine themselves. I can use the same GCC command in Ubuntu Linux (GCC 4.9) without the GCC_COLORS environment variable, and the colouring does work.

I sourced my MinGW GCC 5.2 from https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/dongsheng-daily/, probably the gcc-5-win32 (stable).

gcc -v gives:

Target: i686-w64-mingw32
Configured with: /home/drangon/work/mingw-w64-dgn_32/source/gcc-5.2.0/configure --host=i686-w64-mingw32 --target=i686-w64-mingw32 --disable-nls --enable-languages=c,c++,objc,obj-c++ --with-gmp=/home/drangon/work/mingw-w64-dgn_32/build/for_target --with-mpfr=/home/drangon/work/mingw-w64-dgn_32/build/for_target --with-mpc=/home/drangon/work/mingw-w64-dgn_32/build/for_target --with-isl=/home/drangon/work/mingw-w64-dgn_32/build/for_target --enable-twoprocess --disable-libstdcxx-pch --disable-win32-registry --prefix=/home/drangon/work/mingw-w64-dgn_32/target --with-sysroot=/home/drangon/work/mingw-w64-dgn_32/target
Thread model: win32
gcc version 5.2.0 (GCC)

I saw this ticket about this very issue was closed because it was working for someone. https://sourceforge.net/p/mingw-w64/feature-requests/66/

How do I get the error colouring working?

(I did try the gcc-5-win64, which has the same issue... and also clang -fcolor-diagnostics fails, with Clang 3.7.1 sourced from: http://llvm.org/releases/download.html#3.7.1)

1 Answers
Related