LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 8150 - clang -fcolor-diagnostics and !isatty(stderr)
Summary: clang -fcolor-diagnostics and !isatty(stderr)
Status: RESOLVED FIXED
Alias: None
Product: clang
Classification: Unclassified
Component: Driver (show other bugs)
Version: trunk
Hardware: PC All
: P normal
Assignee: Argyrios Kyrtzidis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-14 18:41 PDT by Frits van Bommel
Modified: 2010-09-23 07:56 PDT (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments
Proposed patch (680 bytes, patch)
2010-09-14 18:41 PDT, Frits van Bommel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Frits van Bommel 2010-09-14 18:41:50 PDT
Created attachment 5492 [details]
Proposed patch

Clang's -fcolor-diagnostics command-line option doesn't enable colored diagnostics if it's of the opinion that stderr can't handle them (i.e. StandardErrHasColors() returns false).
IMHO, if this option is explicitly passed to the driver then it should respect that. (For instance, ccache users can't get colored diagnostics otherwise because ccache also caches warnings, so it has to redirect stderr)

I'm attaching a small patch that fixes this.
Comment 1 Ted Kremenek 2010-09-22 12:59:15 PDT
Argiris: When you get a chance, can you review this patch?
Comment 2 Argyrios Kyrtzidis 2010-09-23 07:56:54 PDT
Makes sense, applied at r114638; thanks!