使用Boost 1.47启用-Weffc ++ for c ++项目后的警告

时间:2012-01-02 22:22:08

标签: c++ boost gcc-warning

  

可能重复:
  How to suppress GCC warnings from library headers?

我刚刚激活了-Weffc ++编译器开关, 现在我得到了大量与升级库有关的警告。

这是第一个警告:

In file included from /usr/local/boost_1_47_0/boost/type_traits/detail/bool_trait_def.hpp:15:0,
             from /usr/local/boost_1_47_0/boost/type_traits/is_same.hpp:31,
             from /usr/local/boost_1_47_0/boost/type_traits/intrinsics.hpp:128,
             from /usr/local/boost_1_47_0/boost/type_traits/is_convertible.hpp:15,
             from /usr/local/boost_1_47_0/boost/thread/detail/move.hpp:11,
             from /usr/local/boost_1_47_0/boost/thread/locks.hpp:9,
             from /usr/local/boost_1_47_0/boost/thread/pthread/mutex.hpp:12,
             from /usr/local/boost_1_47_0/boost/thread/mutex.hpp:16,
             from /usr/local/boost_1_47_0/boost/thread/pthread/thread_data.hpp:12,
             from /usr/local/boost_1_47_0/boost/thread/thread.hpp:17,
             from /usr/local/boost_1_47_0/boost/thread.hpp:13,
             from src/tcpserver.cpp:4:
/usr/local/boost_1_47_0/boost/type_traits/integral_constant.hpp:25:19: warning: base class ‘struct mpl_::bool_<true>’ has a non-virtual destructor [-Weffc++]

我只想更好地制作自己的代码, 那么如何阻止编译器对非用户生成的头文件发出警告?

或者有没有办法限制搜索的深度? 这可能会有所帮助,因为boost包含非常嵌套(请参阅上面的警告)。

0 个答案:

没有答案