[PATCH] GDB testsuite: Suppress GCC's colored output

Simon Marchi simon.marchi@polymtl.ca
Fri Aug 4 12:19:00 GMT 2017


On 2017-08-04 13:06, Yao Qi wrote:
> Andreas Arnez <arnez@linux.vnet.ibm.com> writes:
> 
> Hi Andreas,
> 
>> +    # Stop the compiler from producing colored output.
>> +    setenv GCC_COLORS ""
>> +
> 
> This doesn't work for remote host.  How about passing option
> -fno-color-diagnostics to compiler which supports that option?  Both 
> gcc
> (4.9 and later) and clang has this option.

My gcc (5.4) doesn't recognize it:

$ gcc -fno-color-diagnostics test.c
gcc: error: unrecognized command line option ‘-fno-color-diagnostics’

It knows about -fdiagnostics-color=never however, which clang seems to 
recognize as well.  It would be nice however not to restrict the 
compiler version used for testing just for this.  Can we write a small 
proc that checks if the compiler recognizes that flag and only include 
it if it does?

Simon



More information about the Gdb-patches mailing list