Disable warnings of third-party headers

Sometimes it is very annoying that the compiler always tells me there is a lot of warning in third-party headers. For example, boost headers.

After google awhile and found a solution to that in Stack-flow.
Just use #pragma to wrap the third-party and it’s done!

For example:

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#include <boost/thread.hpp>
#pragma GCC diagnostic pop

Published by

Need-Being

You never know me... Need-Being... Human Being? or Just Being Here...

Leave a Reply

Your email address will not be published. Required fields are marked *