This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][mingw] Enable colorized diagnostics
- From: David Malcolm <dmalcolm at redhat dot com>
- To: JonY <10walls at gmail dot com>, Liu Hao <lh_mouse at 126 dot com>, Joseph Myers <joseph at codesourcery dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 09 Oct 2017 10:16:44 -0400
- Subject: Re: [PATCH][mingw] Enable colorized diagnostics
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=dmalcolm at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E67A7D6854
- References: <7a71ece2.2bf.15ec4a65660.Coremail.lh_mouse@126.com> <alpine.DEB.2.20.1709272008360.32152@digraph.polyomino.org.uk> <ec5058b5-a0fd-75d7-2307-fb1354d0b63e@126.com> <223ab272-26b9-6079-df18-8c5da0031c2f@gmail.com>
On Mon, 2017-10-09 at 11:01 +0000, JonY wrote:
> On 10/08/2017 11:39 AM, Liu Hao wrote:
> > On 2017/9/28 4:09, Joseph Myers wrote:
> > > On Thu, 28 Sep 2017, Liu Hao wrote:
> > >
> > > > Colorized diagnostics used to be disabled for MinGW targets (on
> > > > which
> > > > the macro `_WIN32` is defined), and this patch enables it.
> > >
> > > I'd hope this is all to do with MinGW host, and nothing to do
> > > with the
> > > target.
> > >
> >
> > Ping? Are there any more opinions about this?
> >
>
> I'm not sure if it should be enabled by default due to the
> interleaving
> problem, but seeing as the user has to go out to set GCC_COLORS to
> use
> this feature, I suppose it is OK.
>
> I will commit soon if there are no more comments.
I have some concerns about adding non-trivial host-specific code to the
diagnostics subsystem.
I occasionally make changes to the files you're touching, but I don't
have access to the host in question, so I can't test that I don't break
things on MinGW.
Is it OK if this is the MinGW team's problem, and not mine? (i.e. can
you please clean up after me if I break something on MinGW?).
Also, you might want to add some selftests to the code e.g. for
find_esc_head and find_esc_terminator. I looked at the docs for the
Windows console API and unfortunately there doesn't seem to be a way to
set up a dummy console for unit-testing the parts of the code that call
the console API directly. But find_esc_head and find_esc_terminator
don't directly call the API, and hence you can write some selftest
functions for them. (there's probably a much more involved way to test
this using mocks/stubs for the console API, but that's probably
overkill).
Dave