有没有办法在 gcc/g++ 的输出中引入语法高亮显示?

Is there a way to introduce syntax highlighting to gcc/g++'s output?

当我用 gcc 或 g++ 编译程序时,有没有办法在我得到的输出中引入语法高亮显示。目前它都是一种颜色。我希望颜色根据输出而改变。

这是作为 Perl 脚本完成的 colorgcc

进一步讨论:

  • Improving g++ output
  • g++, colorgcc and ccache