This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: color diagnostics markers

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,

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 &lsquo;<b>int foo()</b>&rsquo;:
+    <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 &lsquo;<b>struct X&lt;100&gt;</b>&rsquo;
+     template &lt;int N&gt; struct X { static const int value = X&lt;N-1&gt;::value; }; template struct X&lt;1000&gt;;
+                                                  <b style='color:lime'>^</b>
+    <b>test.C:2:46:</b>   recursively required from &lsquo;<b>const int X&lt;999&gt;::value</b>&rsquo;
+    <b>test.C:2:46:</b>   required from &lsquo;<b>const int X&lt;1000&gt;::value</b>&rsquo;
+    <b>test.C:2:88:</b>   required from here
+    <b>test.C:2:46:</b> <b style='color:red'>error:</b> incomplete type &lsquo;<b>X&lt;100&gt;</b>&rsquo; used in nested name specifier
+    </pre></li>
+  </ul>           


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]