Actions
Bug #4790
closed-Wextra-semi and -Wundefined-func-template cause build warnings/errors on FreeBSD
Start date:
Due date:
% Done:
100%
Estimated time:
Tags:
Description
On FreeBSD 11.2, with clang 6.0.0, the options -Wextra-semi
and -Wundefined-func-template
cause tons of warnings (see examples below), which become fatal errors if configured with --debug
. Fortunately, all these warnings come from boost headers, not from our code, so I propose to disable the extra warning flags on FreeBSD. I'm not sure why these warnings aren't triggered by clang on Linux or macOS.
[ 1/202] Compiling ndn-cxx/common-pch.hpp
In file included from <built-in>:1:
In file included from ./../ndn-cxx/common-pch.hpp:47:
In file included from ../../../../local/include/boost/multi_index_container.hpp:22:
../../../../local/include/boost/detail/allocator_utilities.hpp:47:36: error: extra ';' after member function definition [-Werror,-Wextra-semi]
partial_std_allocator_wrapper(){};
^
../../../../local/include/boost/detail/allocator_utilities.hpp:55:4: error: extra ';' after member function definition [-Werror,-Wextra-semi]
};
^
In file included from <built-in>:1:
In file included from ./../ndn-cxx/common-pch.hpp:47:
In file included from ../../../../local/include/boost/multi_index_container.hpp:55:
../../../../local/include/boost/multi_index/detail/serialization_version.hpp:38:74: error: extra ';' after member function definition [-Werror,-Wextra-semi]
serialization_version& operator=(unsigned int x){value=x;return *this;};
^
In file included from <built-in>:1:
In file included from ./../ndn-cxx/common-pch.hpp:47:
In file included from ../../../../local/include/boost/multi_index_container.hpp:56:
../../../../local/include/boost/serialization/collection_size_type.hpp:25:36: error: extra ';' after member function definition [-Werror,-Wextra-semi]
collection_size_type(): t(0) {};
^
In file included from <built-in>:1:
In file included from ./../ndn-cxx/common-pch.hpp:48:
In file included from ../../../../local/include/boost/range/adaptors.hpp:27:
In file included from ../../../../local/include/boost/range/adaptor/tokenized.hpp:14:
In file included from ../../../../local/include/boost/regex.hpp:31:
In file included from ../../../../local/include/boost/regex/v4/regex.hpp:88:
In file included from ../../../../local/include/boost/regex/v4/perl_matcher.hpp:615:
../../../../local/include/boost/regex/v4/perl_matcher_non_recursive.hpp:67:101: error: extra ';' after member function definition [-Werror,-Wextra-semi]
saved_matched_paren(int i, const sub_match<BidiIterator>& s) : saved_state(1), index(i), sub(s){};
^
../../../../local/include/boost/regex/v4/perl_matcher_non_recursive.hpp:75:115: error: extra ';' after member function definition [-Werror,-Wextra-semi]
saved_position(const re_syntax_base* ps, BidiIterator pos, int i) : saved_state(i), pstate(ps), position(pos){};
^
../../../../local/include/boost/regex/v4/perl_matcher_non_recursive.hpp:83:83: error: extra ';' after member function definition [-Werror,-Wextra-semi]
: saved_position<BidiIterator>(ps, pos, saved_type_assertion), positive(p){};
^
7 errors generated.
[ 3/379] Compiling ndn-cxx/face.cpp
In file included from ../ndn-cxx/face.cpp:24:
In file included from ../ndn-cxx/impl/face-impl.hpp:37:
In file included from ../ndn-cxx/util/logger.hpp:31:
In file included from ../../../../local/include/boost/log/common.hpp:25:
../../../../local/include/boost/log/sources/record_ostream.hpp:506:49: error: instantiation of function 'boost::log::v2_mt_posix::aux::stream_provider<char>::allocate_compound' required here, but no definition is available [-Werror,-Wundefined-func-template]
m_pStreamCompound(stream_provider_type::allocate_compound(rec)),
^
../../../../local/include/boost/log/sources/record_ostream.hpp:542:12: note: in instantiation of member function 'boost::log::v2_mt_posix::aux::record_pump<ndn::util::Logger>::record_pump' requested here
return record_pump< LoggerT >(lg, rec);
^
../ndn-cxx/impl/face-impl.hpp:91:5: note: in instantiation of function template specialization 'boost::log::v2_mt_posix::aux::make_record_pump<ndn::util::Logger>' requested here
NDN_LOG_DEBUG("<I " << *interest);
^
../ndn-cxx/util/logger.hpp:262:35: note: expanded from macro 'NDN_LOG_DEBUG'
#define NDN_LOG_DEBUG(expression) NDN_LOG_INTERNAL(DEBUG, DEBUG, expression)
^
../ndn-cxx/util/logger.hpp:247:7: note: expanded from macro 'NDN_LOG_INTERNAL'
NDN_BOOST_LOG(ndn_cxx_getLogger()) << ::ndn::util::detail::LoggerTimestamp{} \
^
../ndn-cxx/util/logger.hpp:240:26: note: expanded from macro 'NDN_BOOST_LOG'
#define NDN_BOOST_LOG(x) BOOST_LOG(x)
^
../../../../local/include/boost/log/sources/record_ostream.hpp:570:27: note: expanded from macro 'BOOST_LOG'
#define BOOST_LOG(logger) BOOST_LOG_STREAM(logger)
^
../../../../local/include/boost/log/sources/record_ostream.hpp:561:5: note: expanded from macro 'BOOST_LOG_STREAM'
BOOST_LOG_STREAM_INTERNAL(logger, BOOST_LOG_UNIQUE_IDENTIFIER_NAME(_boost_log_record_))
^
../../../../local/include/boost/log/sources/record_ostream.hpp:551:28: note: expanded from macro 'BOOST_LOG_STREAM_INTERNAL'
::boost::log::aux::make_record_pump((logger), rec_var).stream()
^
../../../../local/include/boost/log/sources/record_ostream.hpp:447:43: note: forward declaration of template entity is here
BOOST_LOG_API static stream_compound* allocate_compound(record& rec);
^
../../../../local/include/boost/log/sources/record_ostream.hpp:506:49: note: add an explicit instantiation declaration to suppress this warning if 'boost::log::v2_mt_posix::aux::stream_provider<char>::allocate_compound' is explicitly instantiated in another translation unit
m_pStreamCompound(stream_provider_type::allocate_compound(rec)),
^
1 error generated.
Updated by Davide Pesavento about 6 years ago
I'm not sure why these warnings aren't triggered by clang on Linux or macOS.
oh I guess it's the usual system header vs. non-system header (warnings are suppressed for system headers), and since boost headers are in /usr/local/include
on FreeBSD, they are not considered system headers.
Updated by Davide Pesavento about 6 years ago
- Related to Bug #4296: Xcode >= 9.0 triggers -Wundefined-func-template warnings/errors in boost headers added
Updated by Davide Pesavento about 6 years ago
- Status changed from New to Code review
- % Done changed from 0 to 100
Updated by Davide Pesavento almost 6 years ago
- Project changed from ndn-cxx to NFD
- Category changed from Build to Build
- Status changed from Code review to Closed
- Target version changed from Unsupported to Unsupported
Actions