234

I'm working on a project that will read compiler error messages of a particular variety and do useful things with them. The sample codebase I'm testing this on (a random open-source application), and hence rebuilding frequently, contains a few bits that generate warnings, which are of no interest to me.

How do I disable all warnings from GCC, so I can just see error messages if there are any?

Phil Miller
  • 36,389
  • 13
  • 67
  • 90
  • 37
    But please note; you would be better refactoring your code to eliminate the warnings rather than turning them off! – Mitch Wheat Sep 21 '09 at 02:50
  • 74
    @Mitch: I believe I've clarified the question to make it clear that I'm neither responsible for nor interested in these warning messages. They really don't matter for these purposes. – Phil Miller Sep 21 '09 at 03:06

1 Answers1

377

-w is the GCC-wide option to disable warning messages.

Phil Miller
  • 36,389
  • 13
  • 67
  • 90