RE: Question about g++

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Lakshmi,

> Is there a reason gcc developers do not want this useful feature to be added?

Probably because how coloring text is done is extremely platform dependent.

A suitable compromise may be a configure --enable-ncurses and have GCC use ncurses facilities.  That would only allow color on platforms supported by ncurses, and even then only with terminals settings which support color.

Then add a --color switch to the gcc/g++ front end tool chain driver (since you probably don't want the embedded escape sequences if piping the output hither-and-yon, such as in an IDE like Xcode).

An alternative solution is to have a output processor (a GCC post-processor) which color-izes the output.  That is a small-ish program, could be written in Perl, Python or Ruby, and the output of said program could be HTML or terminal coloring (perhaps itself using ncurses), or whatever is suitable for your platform.  Hmmm, that's what the colorifier and colorgcc do already.  Downside being that different GCC versions may subtly change their output, which can confound a color-izing filter from the wrong GCC vintage.

Another alternative is to use vi (Vim) and make a syntax coloring schema which is savvy on the GCC output.  That way you could do...

gcc -c foo.c -o foo.o | vi -

You do use Vim, right?  The one true editor?  :-)

Sincerely,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux