当C / C++编译器给我警告或错误时,很难过滤它们。是否有一些简单的终端程序或脚本来突出显示它们?

现在他们看起来像

lk@minetoo ~/proj/mgi2 $ make
g++ -lpthread -o mgi.r mgi.cpp
In file included from mgi.cpp:19:0:
paux.hpp:101:1: error: expected class-name before '{' token
paux.hpp:104:1: error: expected unqualified-id before '}' token
mgi.cpp: In constructor 'Server::Server()':
mgi.cpp:73:57: warning: deprecated conversion from string constant to 'char*'
mgi.cpp:78:84: warning: deprecated conversion from string constant to 'char*'
mgi.cpp: In member function 'int Server::run()':
mgi.cpp:84:62: warning: deprecated conversion from string constant to 'char*'
mgi.cpp:92:52: warning: deprecated conversion from string constant to 'char*'
make: *** [mgi] Error 1

最佳答案

我为此使用 colorgcc 。效果很好。

07-28 02:18