Opened 10 years ago

Closed 8 years ago

#7628 closed Feature Requests (fixed)

[signals2] Noisy g++ warning generated by 'unused' parameter

Reported by: boost@… Owned by: Frank Mori Hess
Milestone: To Be Determined Component: signals2
Version: Boost 1.51.0 Severity: Cosmetic
Keywords: Cc:

Description

An unused parameter (args) warning in .../signals2/details/variadic_slot_invoker.hpp:87

I'm seeing the warning with g++ 4.6 for Linux x86 and g++ 4.5 for Linux Arm. Not tried with 4.7.

This may be an over-zealous compiler, but it would be nice if it could be suppressed because it generates a lot of noise.

Perhaps a:

#if BOOST_WORKAROUND(__GNUC__, <= 4) && BOOST_WORKAROUND(__GNUC_MINOR__, <= 6)
          static_cast<void>(args);
#endif

Here's the noise generated (g++ 4.6):

(-std=c++0x -O2 -Wall -W)

In file include from ...<snip>

.../boost/boost_1_51_0/boost/signals2/detail/variadic_slot_invoker.hpp: In member function ‘R boost::signals2::detail::call_with_tuple_args<R>::m_invoke(void*, Func&, boost::signals2::detail::unsigned_meta_array<indices ...>, std::tuple<Args ...>) const [with Func = boost::function<void()>, unsigned int ...indices = {}, Args = {}, R = boost::signals2::detail::void_type]’:
.../boost/boost_1_51_0/boost/signals2/detail/variadic_slot_invoker.hpp:78:63:   instantiated from ‘R boost::signals2::detail::call_with_tuple_args<R>::operator()(Func&, std::tuple<_Args2 ...>) const [with Func = boost::function<void()>, Args = {}, R = boost::signals2::detail::void_type]’
.../boost/boost_1_51_0/boost/signals2/detail/variadic_slot_invoker.hpp:117:97:   instantiated from ‘boost::signals2::detail::variadic_slot_invoker<R, Args>::result_type boost::signals2::detail::variadic_slot_invoker<R, Args>::m_invoke(const ConnectionBodyType&, const boost::signals2::detail::void_type*) const [with ConnectionBodyType = boost::shared_ptr<boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void(), boost::function<void()> >, boost::signals2::mutex> >, R = boost::signals2::detail::void_type, Args = {}, boost::signals2::detail::variadic_slot_invoker<R, Args>::result_type = boost::signals2::detail::void_type]’
.../boost/boost_1_51_0/boost/signals2/detail/variadic_slot_invoker.hpp:110:21:   instantiated from ‘boost::signals2::detail::variadic_slot_invoker<R, Args>::result_type boost::signals2::detail::variadic_slot_invoker<R, Args>::operator()(const ConnectionBodyType&) const [with ConnectionBodyType = boost::shared_ptr<boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void(), boost::function<void()> >, boost::signals2::mutex> >, R = boost::signals2::detail::void_type, Args = {}, boost::signals2::detail::variadic_slot_invoker<R, Args>::result_type = boost::signals2::detail::void_type]’
.../boost/boost_1_51_0/boost/signals2/detail/slot_call_iterator.hpp:82:15:   instantiated from ‘typename boost::signals2::detail::slot_call_iterator_t<Function, Iterator, ConnectionBody>::inherited::reference boost::signals2::detail::slot_call_iterator_t<Function, Iterator, ConnectionBody>::dereference() const [with Function = boost::signals2::detail::variadic_slot_invoker<boost::signals2::detail::void_type>, Iterator = std::_List_iterator<boost::shared_ptr<boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void(), boost::function<void()> >, boost::signals2::mutex> > >, ConnectionBody = boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void(), boost::function<void()> >, boost::signals2::mutex>, typename boost::signals2::detail::slot_call_iterator_t<Function, Iterator, ConnectionBody>::inherited::reference = const boost::signals2::detail::void_type&]’
.../boost/boost_1_51_0/boost/iterator/iterator_facade.hpp:514:32:   instantiated from ‘static typename Facade::reference boost::iterator_core_access::dereference(const Facade&) [with Facade = boost::signals2::detail::slot_call_iterator_t<boost::signals2::detail::variadic_slot_invoker<boost::signals2::detail::void_type>, std::_List_iterator<boost::shared_ptr<boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void(), boost::function<void()> >, boost::signals2::mutex> > >, boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void(), boost::function<void()> >, boost::signals2::mutex> >, typename Facade::reference = const boost::signals2::detail::void_type&]’
.../boost/boost_1_51_0/boost/iterator/iterator_facade.hpp:639:67:   instantiated from ‘boost::iterator_facade<I, V, TC, R, D>::reference boost::iterator_facade<I, V, TC, R, D>::operator*() const [with Derived = boost::signals2::detail::slot_call_iterator_t<boost::signals2::detail::variadic_slot_invoker<boost::signals2::detail::void_type>, std::_List_iterator<boost::shared_ptr<boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void(), boost::function<void()> >, boost::signals2::mutex> > >, boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void(), boost::function<void()> >, boost::signals2::mutex> >, Value = boost::signals2::detail::void_type, CategoryOrTraversal = boost::single_pass_traversal_tag, Reference = const boost::signals2::detail::void_type&, Difference = int, boost::iterator_facade<I, V, TC, R, D>::reference = const boost::signals2::detail::void_type&]’
.../boost/boost_1_51_0/boost/signals2/optional_last_value.hpp:55:13:   instantiated from ‘boost::signals2::optional_last_value<void>::result_type boost::signals2::optional_last_value<void>::operator()(InputIterator, InputIterator) const [with InputIterator = boost::signals2::detail::slot_call_iterator_t<boost::signals2::detail::variadic_slot_invoker<boost::signals2::detail::void_type>, std::_List_iterator<boost::shared_ptr<boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void(), boost::function<void()> >, boost::signals2::mutex> > >, boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void(), boost::function<void()> >, boost::signals2::mutex> >, boost::signals2::optional_last_value<void>::result_type = void]’
.../boost/boost_1_51_0/boost/signals2/detail/result_type_wrapper.hpp:64:11:   instantiated from ‘boost::signals2::detail::combiner_invoker<void>::result_type boost::signals2::detail::combiner_invoker<void>::operator()(Combiner&, InputIterator, InputIterator) const [with Combiner = boost::signals2::optional_last_value<void>, InputIterator = boost::signals2::detail::slot_call_iterator_t<boost::signals2::detail::variadic_slot_invoker<boost::signals2::detail::void_type>, std::_List_iterator<boost::shared_ptr<boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void(), boost::function<void()> >, boost::signals2::mutex> > >, boost::signals2::detail::connection_body<std::pair<boost::signals2::detail::slot_meta_group, boost::optional<int> >, boost::signals2::slot<void(), boost::function<void()> >, boost::signals2::mutex> >, boost::signals2::detail::combiner_invoker<void>::result_type = void]’
.../boost/boost_1_51_0/boost/signals2/detail/signal_template.hpp:246:13:   instantiated from ‘boost::signals2::detail::signal_impl<R(Args ...), Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex>::result_type boost::signals2::detail::signal_impl<R(Args ...), Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex>::operator()(Args ...) [with Combiner = boost::signals2::optional_last_value<void>, Group = int, GroupCompare = std::less<int>, SlotFunction = boost::function<void()>, ExtendedSlotFunction = boost::function<void(const boost::signals2::connection&)>, Mutex = boost::signals2::mutex, R = void, Args = {}, boost::signals2::detail::signal_impl<R(Args ...), Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex>::result_type = void]’
.../boost/boost_1_51_0/boost/signals2/detail/signal_template.hpp:695:85:   instantiated from ‘boost::signals2::signal<R(Args ...), Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex>::result_type boost::signals2::signal<R(Args ...), Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex>::operator()(Args ...) [with Combiner = boost::signals2::optional_last_value<void>, Group = int, GroupCompare = std::less<int>, SlotFunction = boost::function<void()>, ExtendedSlotFunction = boost::function<void(const boost::signals2::connection&)>, Mutex = boost::signals2::mutex, R = void, Args = {}, boost::signals2::signal<R(Args ...), Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex>::result_type = void]’
privateFile.cpp:98:24:   instantiated from here
.../boost/boost_1_51_0/boost/signals2/detail/variadic_slot_invoker.hpp:87:13: warning: parameter ‘args’ set but not used [-Wunused-but-set-parameter]

Change History (1)

comment:1 by Frank Mori Hess, 8 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.