I would like to submit a patch to colorgcc that makes it colorize gcc 3.x.x output on multiple lines as version 1.3.2 only does this on 1 line. I have corrected some minor colorization bugs too. Reproducible: Always Steps to Reproduce: 1. launch a compilation with gcc 3.x.x that produces a long warning or error. 2. 3. Actual Results: no use Expected Results: no use patch is being built from : * dev-util/colorgcc Latest version available: 1.3.2-r3 Latest version installed: 1.3.2-r3 please dowload the patch from http://www.chx-labs.org/XFred/colorgcc-1.3.2-r3.patch -- frederic Delaunay <XFred@nekeme.net>
There are some problems with this patch: - The changes to srcscan() match in $_ but substitute in $line which means that it won't handle the srcscan($field, ...) calls correctly. - The prefixes an extra $srcon when finishing a quote. - The code commented with "the line follows" matches all lines, so nothing ever gets to the "Anything else" section. Does this mean we color too much? What about the non-gcc compilers we support? Minor quibbles: - Indentation is not consistent with original. - All-upper-case variables traditionally indicate that a value is constant (after initialization) but these aren't constant. - No need to look for finishing quote unless $CONT is set. Changes needed to work with 15387: - Code is now "use strict". - Regex for ":...message..." lines already handled, so perhaps the regex change isn't needed for that version. I'll attach a patch that is relative to the 15387 version.
Created attachment 18094 [details, diff] My version of the patch that will apply after bug 15387's changes. I changed some of the variable names, tweaked some of the logic, and fixed all the aforementioned bugs. There's still the issue of whether we're outputting too much color which I think should still be looked into.
Resolving as FIXED. The patch included on this bug is in CVS now in dev-util/colorgcc-1.3.2-r4. This clears the way for Bug #2679 to be dealt with.