239

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?

2
  • 37
    But please note; you would be better refactoring your code to eliminate the warnings rather than turning them off! Sep 21, 2009 at 2:50
  • 75
    @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. Sep 21, 2009 at 3:06

1 Answer 1

385

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

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.