highlight and filter (gcc) compiler messages

后端 未结 8 1364
情话喂你
情话喂你 2021-01-06 09:11

i\'m currently refactoring a C-project, throwing about 1000 warnings at me. is there a way to highlight and filter these warnings. (eg make all index warnings red, unused bl

8条回答
  •  有刺的猬
    2021-01-06 09:36

    This is really basic, but I've been using grep...

    make 2>&1 | grep --color -iP "\^|warning:|error:|"
    

    just to quickly draw the eye to the error line and offending section pointed to by ^.

    enter image description here

    I've found other methods over-use colour and you end up with the same problem. I guess you could also inject colour escape sequences with sed.

提交回复
热议问题