Boost C++ Libraries: Ticket #7628: [signals2] Noisy g++ warning generated by 'unused' parameter https://svn.boost.org/trac10/ticket/7628 <p> An unused parameter (args) warning in .../signals2/details/variadic_slot_invoker.hpp:87 </p> <p> I'm seeing the warning with g++ 4.6 for Linux x86 and g++ 4.5 for Linux Arm. Not tried with 4.7. </p> <p> This may be an over-zealous compiler, but it would be nice if it could be suppressed because it generates a lot of noise. </p> <p> Perhaps a: </p> <pre class="wiki">#if BOOST_WORKAROUND(__GNUC__, &lt;= 4) &amp;&amp; BOOST_WORKAROUND(__GNUC_MINOR__, &lt;= 6) static_cast&lt;void&gt;(args); #endif </pre><p> Here's the noise generated (g++ 4.6): </p> <p> (-std=c++0x -O2 -Wall -W) </p> <pre class="wiki">In file include from ...&lt;snip&gt; .../boost/boost_1_51_0/boost/signals2/detail/variadic_slot_invoker.hpp: In member function ‘R boost::signals2::detail::call_with_tuple_args&lt;R&gt;::m_invoke(void*, Func&amp;, boost::signals2::detail::unsigned_meta_array&lt;indices ...&gt;, std::tuple&lt;Args ...&gt;) const [with Func = boost::function&lt;void()&gt;, 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&lt;R&gt;::operator()(Func&amp;, std::tuple&lt;_Args2 ...&gt;) const [with Func = boost::function&lt;void()&gt;, 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&lt;R, Args&gt;::result_type boost::signals2::detail::variadic_slot_invoker&lt;R, Args&gt;::m_invoke(const ConnectionBodyType&amp;, const boost::signals2::detail::void_type*) const [with ConnectionBodyType = boost::shared_ptr&lt;boost::signals2::detail::connection_body&lt;std::pair&lt;boost::signals2::detail::slot_meta_group, boost::optional&lt;int&gt; &gt;, boost::signals2::slot&lt;void(), boost::function&lt;void()&gt; &gt;, boost::signals2::mutex&gt; &gt;, R = boost::signals2::detail::void_type, Args = {}, boost::signals2::detail::variadic_slot_invoker&lt;R, Args&gt;::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&lt;R, Args&gt;::result_type boost::signals2::detail::variadic_slot_invoker&lt;R, Args&gt;::operator()(const ConnectionBodyType&amp;) const [with ConnectionBodyType = boost::shared_ptr&lt;boost::signals2::detail::connection_body&lt;std::pair&lt;boost::signals2::detail::slot_meta_group, boost::optional&lt;int&gt; &gt;, boost::signals2::slot&lt;void(), boost::function&lt;void()&gt; &gt;, boost::signals2::mutex&gt; &gt;, R = boost::signals2::detail::void_type, Args = {}, boost::signals2::detail::variadic_slot_invoker&lt;R, Args&gt;::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&lt;Function, Iterator, ConnectionBody&gt;::inherited::reference boost::signals2::detail::slot_call_iterator_t&lt;Function, Iterator, ConnectionBody&gt;::dereference() const [with Function = boost::signals2::detail::variadic_slot_invoker&lt;boost::signals2::detail::void_type&gt;, Iterator = std::_List_iterator&lt;boost::shared_ptr&lt;boost::signals2::detail::connection_body&lt;std::pair&lt;boost::signals2::detail::slot_meta_group, boost::optional&lt;int&gt; &gt;, boost::signals2::slot&lt;void(), boost::function&lt;void()&gt; &gt;, boost::signals2::mutex&gt; &gt; &gt;, ConnectionBody = boost::signals2::detail::connection_body&lt;std::pair&lt;boost::signals2::detail::slot_meta_group, boost::optional&lt;int&gt; &gt;, boost::signals2::slot&lt;void(), boost::function&lt;void()&gt; &gt;, boost::signals2::mutex&gt;, typename boost::signals2::detail::slot_call_iterator_t&lt;Function, Iterator, ConnectionBody&gt;::inherited::reference = const boost::signals2::detail::void_type&amp;]’ .../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&amp;) [with Facade = boost::signals2::detail::slot_call_iterator_t&lt;boost::signals2::detail::variadic_slot_invoker&lt;boost::signals2::detail::void_type&gt;, std::_List_iterator&lt;boost::shared_ptr&lt;boost::signals2::detail::connection_body&lt;std::pair&lt;boost::signals2::detail::slot_meta_group, boost::optional&lt;int&gt; &gt;, boost::signals2::slot&lt;void(), boost::function&lt;void()&gt; &gt;, boost::signals2::mutex&gt; &gt; &gt;, boost::signals2::detail::connection_body&lt;std::pair&lt;boost::signals2::detail::slot_meta_group, boost::optional&lt;int&gt; &gt;, boost::signals2::slot&lt;void(), boost::function&lt;void()&gt; &gt;, boost::signals2::mutex&gt; &gt;, typename Facade::reference = const boost::signals2::detail::void_type&amp;]’ .../boost/boost_1_51_0/boost/iterator/iterator_facade.hpp:639:67: instantiated from ‘boost::iterator_facade&lt;I, V, TC, R, D&gt;::reference boost::iterator_facade&lt;I, V, TC, R, D&gt;::operator*() const [with Derived = boost::signals2::detail::slot_call_iterator_t&lt;boost::signals2::detail::variadic_slot_invoker&lt;boost::signals2::detail::void_type&gt;, std::_List_iterator&lt;boost::shared_ptr&lt;boost::signals2::detail::connection_body&lt;std::pair&lt;boost::signals2::detail::slot_meta_group, boost::optional&lt;int&gt; &gt;, boost::signals2::slot&lt;void(), boost::function&lt;void()&gt; &gt;, boost::signals2::mutex&gt; &gt; &gt;, boost::signals2::detail::connection_body&lt;std::pair&lt;boost::signals2::detail::slot_meta_group, boost::optional&lt;int&gt; &gt;, boost::signals2::slot&lt;void(), boost::function&lt;void()&gt; &gt;, boost::signals2::mutex&gt; &gt;, Value = boost::signals2::detail::void_type, CategoryOrTraversal = boost::single_pass_traversal_tag, Reference = const boost::signals2::detail::void_type&amp;, Difference = int, boost::iterator_facade&lt;I, V, TC, R, D&gt;::reference = const boost::signals2::detail::void_type&amp;]’ .../boost/boost_1_51_0/boost/signals2/optional_last_value.hpp:55:13: instantiated from ‘boost::signals2::optional_last_value&lt;void&gt;::result_type boost::signals2::optional_last_value&lt;void&gt;::operator()(InputIterator, InputIterator) const [with InputIterator = boost::signals2::detail::slot_call_iterator_t&lt;boost::signals2::detail::variadic_slot_invoker&lt;boost::signals2::detail::void_type&gt;, std::_List_iterator&lt;boost::shared_ptr&lt;boost::signals2::detail::connection_body&lt;std::pair&lt;boost::signals2::detail::slot_meta_group, boost::optional&lt;int&gt; &gt;, boost::signals2::slot&lt;void(), boost::function&lt;void()&gt; &gt;, boost::signals2::mutex&gt; &gt; &gt;, boost::signals2::detail::connection_body&lt;std::pair&lt;boost::signals2::detail::slot_meta_group, boost::optional&lt;int&gt; &gt;, boost::signals2::slot&lt;void(), boost::function&lt;void()&gt; &gt;, boost::signals2::mutex&gt; &gt;, boost::signals2::optional_last_value&lt;void&gt;::result_type = void]’ .../boost/boost_1_51_0/boost/signals2/detail/result_type_wrapper.hpp:64:11: instantiated from ‘boost::signals2::detail::combiner_invoker&lt;void&gt;::result_type boost::signals2::detail::combiner_invoker&lt;void&gt;::operator()(Combiner&amp;, InputIterator, InputIterator) const [with Combiner = boost::signals2::optional_last_value&lt;void&gt;, InputIterator = boost::signals2::detail::slot_call_iterator_t&lt;boost::signals2::detail::variadic_slot_invoker&lt;boost::signals2::detail::void_type&gt;, std::_List_iterator&lt;boost::shared_ptr&lt;boost::signals2::detail::connection_body&lt;std::pair&lt;boost::signals2::detail::slot_meta_group, boost::optional&lt;int&gt; &gt;, boost::signals2::slot&lt;void(), boost::function&lt;void()&gt; &gt;, boost::signals2::mutex&gt; &gt; &gt;, boost::signals2::detail::connection_body&lt;std::pair&lt;boost::signals2::detail::slot_meta_group, boost::optional&lt;int&gt; &gt;, boost::signals2::slot&lt;void(), boost::function&lt;void()&gt; &gt;, boost::signals2::mutex&gt; &gt;, boost::signals2::detail::combiner_invoker&lt;void&gt;::result_type = void]’ .../boost/boost_1_51_0/boost/signals2/detail/signal_template.hpp:246:13: instantiated from ‘boost::signals2::detail::signal_impl&lt;R(Args ...), Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex&gt;::result_type boost::signals2::detail::signal_impl&lt;R(Args ...), Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex&gt;::operator()(Args ...) [with Combiner = boost::signals2::optional_last_value&lt;void&gt;, Group = int, GroupCompare = std::less&lt;int&gt;, SlotFunction = boost::function&lt;void()&gt;, ExtendedSlotFunction = boost::function&lt;void(const boost::signals2::connection&amp;)&gt;, Mutex = boost::signals2::mutex, R = void, Args = {}, boost::signals2::detail::signal_impl&lt;R(Args ...), Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex&gt;::result_type = void]’ .../boost/boost_1_51_0/boost/signals2/detail/signal_template.hpp:695:85: instantiated from ‘boost::signals2::signal&lt;R(Args ...), Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex&gt;::result_type boost::signals2::signal&lt;R(Args ...), Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex&gt;::operator()(Args ...) [with Combiner = boost::signals2::optional_last_value&lt;void&gt;, Group = int, GroupCompare = std::less&lt;int&gt;, SlotFunction = boost::function&lt;void()&gt;, ExtendedSlotFunction = boost::function&lt;void(const boost::signals2::connection&amp;)&gt;, Mutex = boost::signals2::mutex, R = void, Args = {}, boost::signals2::signal&lt;R(Args ...), Combiner, Group, GroupCompare, SlotFunction, ExtendedSlotFunction, Mutex&gt;::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] </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7628 Trac 1.4.3 Frank Mori Hess Sat, 16 Aug 2014 01:08:48 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7628#comment:1 https://svn.boost.org/trac10/ticket/7628#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket