[cfe-users] Why doesn't clang use colors for diagnostics by default?

Victor via cfe-users cfe-users at lists.llvm.org
Wed Sep 9 23:40:31 PDT 2015


I'm using command like this:

$ clang++ prg.cpp

My Clang is built from sources. What libraries it needs to 
use colors automatically? Or may be there is some option 
that I can specify for configure?

On Wed, 9 Sep 2015 19:49:21 -0700
  Richard Trieu <rtrieu at google.com> wrote:
> Are you invoking Clang with "clang foo.cc" or "clang 
>-cc1 foo.cc"?  The
> first should detect if you have a color capable terminal 
>and automatically
> turn on color diagnostics while the second needs the 
>flag explicitly.  The
> other possibility is that the Clang you are using was 
>compiled with the
> libraries needed to detect a color terminal, and 
>defaults to no color.
> 
> On Mon, Sep 7, 2015 at 5:15 AM, Victor via cfe-users <
> cfe-users at lists.llvm.org> wrote:
> 
>> Hello, all.
>>
>> Why doesn't clang use colors for diagnostics by default?
>> My environment:
>>
>> $ cat /etc/*-release
>> Red Hat Enterprise Linux Server release 6.3 (Santiago)
>>
>> $ echo $TERM
>> xterm
>>
>> Doc here
>> http://clang.llvm.org/docs/UsersManual.html#formatting-of-diagnostics
>> says: "This option, which defaults to on when a 
>>color-capable terminal is
>> detected". Isn't xterm "a color-capable terminal"?
>>
>> If I give -fcolor-diagnostics explicitly, all works as 
>>expected. But why
>> must I do that? GCC uses colors by default.
>> _______________________________________________
>> cfe-users mailing list
>> cfe-users at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users
>>




More information about the cfe-users mailing list