11

I am building an application in C++, Mac OS X, Qt and using boost libraries. Every time I build a project I get a huge list of warnings only from boost libraries itself.

How to turn them off, so that I can see only my project specific warnings and errors?

BartoszKP
  • 34,786
  • 15
  • 102
  • 130
RLT
  • 4,219
  • 4
  • 37
  • 91

2 Answers2

17

Use -isystem instead of -I to add Boost headers to include path. This option means to treat headers found there as system headers, and suppress warnings originating there.

Laurynas Biveinis
  • 10,547
  • 4
  • 53
  • 66
1

GCC Warning options

I don't believe gcc has any pragmas for turning off specific warnings temporarily, but those can get rid of them on a per-file basis if your build is set up right.

What are the warnings? Even if they originate withing boost, they could be because of how you're using them, in which case you should probably be fixing them rather than ignoring them.

*edit: A further search yielded this suggestion.

Community
  • 1
  • 1
Dennis Zickefoose
  • 10,791
  • 3
  • 29
  • 38