简体   繁体   中英

Suppress warnings from boost includes

I have a c++ application (built under linux with g++ 4.8.3, boost 1.54) that spouts a lot of warnings about boost . Warnings include:

 /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__)

...

There are so many different ones . It looks like from here that you can suppress particular typedef warnings: https://svn.boost.org/trac/boost/ticket/7242

But I would like to be able to suppress all of these warnings. Any suggestions?

As the commenter TC suggests, warnings are suppressed for system headers in gcc. There are (at least) two ways of adding additional system include paths to your gcc build:

  1. -isystem command line option, and
  2. *_INCLUDE_PATH environment variables (where '*' is C , CPLUS , or OBJC ).

These mechanisms also work for clang.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM