I am using boost 1.63 and when I compile my application that includes #include <boost/algorithm/string.hpp>
.
GCC complains:
In file included from /opt/boost/boost/mpl/aux_/na_assert.hpp:23,
from /opt/boost/boost/mpl/arg.hpp:25,
from /opt/boost/boost/mpl/placeholders.hpp:24,
from /opt/boost/boost/iterator/iterator_categories.hpp:17,
from /opt/boost/boost/iterator/iterator_facade.hpp:14,
from /opt/boost/boost/range/iterator_range_core.hpp:27,
from /opt/boost/boost/range/iterator_range.hpp:13,
from /opt/boost/boost/range/as_literal.hpp:22,
from /opt/boost/boost/algorithm/string/trim.hpp:19,
from /opt/boost/boost/algorithm/string.hpp:19,
from [my source that includes <boost/algorithm/string.hpp>]
/opt/boost/boost/mpl/assert.hpp:188:21: warning: unnecessary parentheses in declaration of ‘assert_arg’ [-Wparentheses]
failed ************ (Pred::************
^
/opt/boost/boost/mpl/assert.hpp:193:21: warning: unnecessary parentheses in declaration of ‘assert_not_arg’ [-Wparentheses]
failed ************ (boost::mpl::not_<Pred>::************
^
I looked at the source and complained section is:
template< typename Pred >
failed ************ (Pred::************
assert_arg( void (*)(Pred), typename assert_arg_pred<Pred>::type )
);
template< typename Pred >
failed ************ (boost::mpl::not_<Pred>::************
assert_not_arg( void (*)(Pred), typename assert_arg_pred_not<Pred>::type )
);
Questions:
- what is
failed ************ (Pred::************
? The syntax looks weird to me. - how I can fix it without suppressing all similar warnings? As GCC's warnings are usually valid and helpful in detecting issues.
I searched online, and the closest, related one is this. But its solution seems to just suppress the warnings.
Thanks!
BOOST_MPL_IGNORE_PARENTHESES_WARNING
macro (at least in recent boost) to suppress this message.failed ********
looks like a pointer declaration.-I/opt/boost/boost
. I agree that it is a warning. But I want to turn on-Werror
.grep -r "BOOST_MPL_IGNORE_PARENTHESES_WARNING" .
in/opt/boost
where my boost lives. And it has nothing. Probably boost 1.63 doesn't have it yet.-isystem
flags as per @NikosC's answer. Just use theSYSTEM
argument. i.e.:target_include_directories(myapp SYSTEM PUBLIC "/opt/boost/boost")