4

Is there a way to disable gcc note:s. By notes I mean when you get an error or warning and gcc gives you some extra information about it. So this option would shorten

test.c:3:0: warning: "FOO" redefined
#define FOO 2

test.c:2:0: note: this is the location of the previous definition
#define FOO 1

to just

test.c:3:0: warning: "FOO" redefined
#define FOO 2

I'll occasionally get a wall of note:s when just an the error would be more clear and it would be convenient to skip over them

rtpax
  • 1,687
  • 1
  • 18
  • 32
  • If all else fails there is always `gcc ... | grep -v "note:"`.. – doynax Aug 15 '17 at 18:02
  • unfortunately I'm using a windows machine with mingw right now, otherwise that would be a handy trick for me – rtpax Aug 15 '17 at 18:03
  • Well, there is always `gcc ... | findstr /V "note:"`.. – doynax Aug 15 '17 at 18:05
  • @doynax modified slightly to `2>&1 gcc test.c | findstr /V "note:"` since apparently gcc goes to stderr. Unfortunately this solution does not remove all lines associated with the note, just the note line itself. Though as you said, it helps if all else fails – rtpax Aug 15 '17 at 18:20
  • Fair point. [While possible](https://stackoverflow.com/questions/5631752/how-can-i-use-findstr-with-newline-regular-expression) it does get a tad messy, so may be better off writing a small filtering utility of your own. – doynax Aug 15 '17 at 18:26

0 Answers0