Re: [PATCH][mingw] Enable colorized diagnostics

2017-10-11 Thread JonY
On 10/09/2017 01:07 PM, Liu Hao wrote: > On 2017/10/9 19:01, JonY wrote: >> On 10/08/2017 11:39 AM, Liu Hao wrote: >> >> 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

Re: [PATCH][mingw] Enable colorized diagnostics

2017-10-10 Thread Liu Hao
On 2017/10/11 5:04, Manuel López-Ibáñez wrote: Ops! You're obviously right. What was I thinking? I still believe that pretty-printer.c is not the right place for all this color-handling code (diagnostic-color.c or libiberty/ may be better places). No and yes. The colors emerge only when those

Re: [PATCH][mingw] Enable colorized diagnostics

2017-10-10 Thread Manuel López-Ibáñez
On 10 Oct 2017 2:34 am, "Liu Hao" wrote: Since on *nix it is not when `colorize_start()` is called that the terminal color is changed (it is when those ANSI escape codes are delivered to the other peer which will translate them), and the string passed to `fputs()` is free to deliver multiple esca

Re: [PATCH][mingw] Enable colorized diagnostics

2017-10-09 Thread Liu Hao
On 2017/10/10 6:25, Manuel López-Ibáñez wrote: For what is worth, the color output of GCC comes originally from grep, and grep does have code for colorizing in Windows: http://git.savannah.gnu.org/cgit/grep.git/tree/lib and there are significant differences with this patch. For once,   /* $T

Re: [PATCH][mingw] Enable colorized diagnostics

2017-10-09 Thread Manuel López-Ibáñez
On 09/10/17 23:25, Manuel López-Ibáñez wrote: Even if the host-specific part is not done, I honestly think it is a good idea to match grep's code as much as possible since we may want to merge bugfixes between the two and eventually this code may end up in gnulib. Moreover, if somebody else imp

Re: [PATCH][mingw] Enable colorized diagnostics

2017-10-09 Thread Manuel López-Ibáñez
On 08/10/17 12:39, 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 nothin

Re: [PATCH][mingw] Enable colorized diagnostics

2017-10-09 Thread Liu Hao
On 2017/10/9 22:16, David Malcolm wrote: 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.

Re: [PATCH][mingw] Enable colorized diagnostics

2017-10-09 Thread David Malcolm
On Mon, 2017-10-09 at 11:01 +, 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 def

Re: [PATCH][mingw] Enable colorized diagnostics

2017-10-09 Thread Liu Hao
On 2017/10/9 19:01, JonY wrote: On 10/08/2017 11:39 AM, Liu Hao wrote: 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 comment

Re: [PATCH][mingw] Enable colorized diagnostics

2017-10-09 Thread JonY
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 Mi

Re: [PATCH][mingw] Enable colorized diagnostics

2017-10-08 Thread Liu Hao
On 2017/10/8 20:24, Hannes Domani wrote: Am Sonntag, 8. Oktober 2017, 14:02:48 MESZ hat Liu Hao Folgendes geschrieben: > On 2017/10/8 19:55, Hannes Domani wrote: > > > So why not just enable it on Win10? > > > It is up to you, GCC maintainers. If dropping support for Windows prior > to

Re: [PATCH][mingw] Enable colorized diagnostics

2017-10-08 Thread Liu Hao
On 2017/10/8 19:55, Hannes Domani wrote: So why not just enable it on Win10? It is up to you, GCC maintainers. If dropping support for Windows prior to Windows 10 TH2 is an option, I may provide another patch, which I can't test because I primarily work on Windows 7. XD -- Best regards, LH_

Re: [PATCH][mingw] Enable colorized diagnostics

2017-10-08 Thread Liu Hao
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? Ar

Re: [PATCH][mingw] Enable colorized diagnostics

2017-09-28 Thread Liu Hao
On 2017/9/28 7:37, JonY wrote: Does it make sense to use a global lock in mingw_ansi_fputs? I was thinking about a named Mutex object. Named Mutexes (as well as Events and Semaphores) can be shared across processes, but there are other considerations: 1. The name of the Mutex should base o

Re: [PATCH][mingw] Enable colorized diagnostics

2017-09-27 Thread JonY
On 09/27/2017 08:54 PM, 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 Mi

Re: [PATCH][mingw] Enable colorized diagnostics

2017-09-27 Thread Liu Hao
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. Oh you ar

Re: [PATCH][mingw] Enable colorized diagnostics

2017-09-27 Thread Joseph Myers
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. -- Joseph S. Myers jos...@codesourcery.com

[PATCH][mingw] Enable colorized diagnostics

2017-09-27 Thread Liu Hao
Hello, (I don't have SVN write access. So please apply this patch if you think it is OK. I have got FSF's copyright assignment paper for GCC. I will send you a copy of it when required.) Colorized diagnostics used to be disabled for MinGW targets (on which the macro `_WIN32` is defined), and t