抑制来自boost的警告包括

时间:2014-08-15 01:40:44

标签: c++ boost warnings

我有一个c ++应用程序(在linux下构建,带有g ++ 4.8.3,boost 1.54),它发出了很多关于boost的警告。警告包括:

 /usr/local/include/boost/math/constants/constants.hpp:314:3: warning: non-standard suffix on floating constant [-Wpedantic]
BOOST_DEFINE_MATH_CONSTANT(rayleigh_skewness, 6.311106578189371381918993515442277798e-01, "6.31110657818937138191899351544227779844042203134719497658094585692926819617473725459905027032537306794400047264e-01")

/usr/local/include/boost/concept/detail/general.hpp:71:20: warning: typedef 'boost_concept_check228' locally defined but not used [-Wunused-local-typedefs]
   BOOST_PP_CAT(boost_concept_check,__LINE__)

...

有很多不同的。从这里看起来你可以抑制特定的typedef警告:https://svn.boost.org/trac/boost/ticket/7242

但我希望能够压制所有这些警告。有什么建议?

1 个答案:

答案 0 :(得分:1)

作为评论者T.C.建议,warnings are suppressed for system headers在gcc中。有(至少)两种方法可以添加其他系统包含gcc构建的路径:

  1. -isystem命令行选项和
  2. *_INCLUDE_PATH environment variables(其中'*'为CCPLUSOBJC)。
  3. 这些机制也适用于铿锵。