Want to turn off "note" level messages in GCC
When I compile a C (no pluses) program using GCC, there are several levels of messages possible, like warning, error, and note. The note messages are useless and distracting. How do I make them go away using the command line? (I don’t use any sort of IDE.)
Example: /home/user/src9/AllBack3.c:129:9: note: each undeclared identifier is reported only once for each function it appears in.
-fcompare-debug-second option to
gcc’s internal API has a
diagnostic_inhibit_note() function which turns any "note:" messages off, but that is only serviceable via the unexpected
-fcompare-debug-second command line switch, defined here.
Fortunately, turning notes off is its only effect, unless the
-fcompare-debug or the
-fdump-final-insns options are also used, which afaik are only for debugging the compiler itself.
You can use
-w which also suppresses warnings.
-w will not suppress the note you mentioned, probably because it is shown instead of another error. clang’s
-w on the other hand suppresses that too.