On Fri, Apr 12, 2013 at 12:48:23AM +0200, Tobias Burnus wrote: > Gabriel Dos Reis wrote: > >Patch OK. > > I am not sure whether I have seen the latest patch, but in the one I > saw there is a typo in the .texi text: > > +only when the stdandard error is a terminal. The forms > > "standard"
Fixed, plus fixed 4 remaining GREP_COLORS occurrences to GCC_COLORS, committed. Note that I haven't touched the Fortran frontend, which doesn't use the standard diagnostics routines, so you might want to consider colorizing similarly Fortran FE caret, locus, error:/warning: etc. keywords. > Thanks for the patch, I think it can be quite useful. > > Tobias > > PS: Please also update the GCC 4.9 release notes. Done thusly, took time to translate the colors/bold/quotes into HTML, hope it shows up nicely in all browsers, tried just firefox and elinks. --- gcc-4.9/changes.html 10 Apr 2013 17:29:50 -0000 1.3 +++ gcc-4.9/changes.html 12 Apr 2013 07:13:01 -0000 @@ -31,9 +31,31 @@ --> -<!-- -<h3>C family</h3> ---> +<h3 id="c-family">C family</h3> + + <ul> + <li>Support for colorizing diagnostics emitted by GCC has been added. + The <code>-fdiagnostics-color=auto</code> will enable it when + outputting to terminals, <code>-fdiagnostics-color=always</code> + unconditionally. The <code>GCC_COLORS</code> environment variable + can be used to customize the colors or disable coloring.<br/> + Sample diagnostics output:<br/> + <pre> + $ g++ -fdiagnostics-color=always -S -Wall test.C + test.C: In function ‘<b>int foo()</b>’: + <b>test.C:1:14:</b> <b style='color:magenta'>warning:</b> no return statement in function returning non-void [-Wreturn-type] + int foo () { } + <b style='color:lime'>^</b> + <b>test.C:2:46:</b> <b style='color:red'>error:</b> template instantiation depth exceeds maximum of 900 (use -ftemplate-depth= to increase the maximum) instantiating ‘<b>struct X<100></b>’ + template <int N> struct X { static const int value = X<N-1>::value; }; template struct X<1000>; + <b style='color:lime'>^</b> + <b>test.C:2:46:</b> recursively required from ‘<b>const int X<999>::value</b>’ + <b>test.C:2:46:</b> required from ‘<b>const int X<1000>::value</b>’ + <b>test.C:2:88:</b> required from here + + <b>test.C:2:46:</b> <b style='color:red'>error:</b> incomplete type ‘<b>X<100></b>’ used in nested name specifier + </pre></li> + </ul> <!-- <h3>C</h3> Jakub