Disable color errors globally?

Is there some way to pass options to clang "globally" and
without having to get down and manually edit an entire
set of Makefiles?

I'm particularly eager to do this, if possible, for the
following option: -fno-color-diagnostics

My rationale, is that when/if I am sending some developer a
typescript log of an entire (failed) build process, whatever
he/she happens to end up viewing that "plain text" file with
may or may not display the color-changing escape sequences
as actual color changes, rather than unreadable gibberish.

Has anyone ever actually experienced such a problem/issue?

Haven’t investigated at all, but why not just set your terminal to not display colors?, e.g., TERM=xterm, or something like that?

In message <CAL2T-v61We_KVFNcO8iyy0BOw7MwF7B_V-Gt7yBWyU6Ob4bwCw@mail.gmail.com>

Haven't investigated at all, but why not just set your terminal to not
display colors?, e.g., TERM=xterm, or something like that?

Ummm... my TERM environment variable is already set to xterm.

I see the pretty colors anyway.

Maybe I should try setting TERM to "bogus". I guess I'll gve it a try.

(I guess I should also try also unsetting TERMCAP.)

It's an interesting question anyway. If you inherited a bunch of code
from somebody else, and didn't want to go groveling through all of the
Makefiles in the whole tree, just to (universally) set some particular
clang command line option for all complies, it might be be handy if
clang were to support passing it options via some environment variable.

What about using a bash alias to add it? Something like:

alias clang++="/usr/bin/clang++ -fno-diagnostic-color" (or whatever it ends up being)?

In message <D0DD9254EE9DB04FA7C8606D0828DA6AD3A8DE13@ORSMSX122.amr.corp.intel.c

if you set TERM=dumb, clang (nor most any other tool) will emit vt escape codes.

if you set TERM=dumb, clang (nor most any other tool) will emit vt escape
codes.

Thank you. That's my solution them.

Cool, wish i’d Been smart enough to suggest dumb in the first place… :wink:

CCC_OVERRIDE_OPTIONS="+-fno-color-diagnostics" clang /tmp/f.cc

You can find the implementation in clang/tools/driver/driver.cpp.

Dmitri

In message <CA+Y5xYeZVdvN_NpLuPttbc9s5S0cTg5HrCLZrVPthJdL44N+GQ@mail.gmail.com>

I still think TERM=dumb ninja is easier in this case, but good to know you can override anything.

In message <CAL2T-v4FP6N+NNUaKH1jY-o_8iJRgJDaDqdpzNx-cNGAVVOY1g@mail.gmail.com>