[Boost-bugs] [Boost C++ Libraries] #3601: Patch for warning fixes

Subject: [Boost-bugs] [Boost C++ Libraries] #3601: Patch for warning fixes
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-11-09 17:32:10


#3601: Patch for warning fixes
--------------------------+-------------------------------------------------
 Reporter: johnmaddock | Owner:
     Type: Patches | Status: new
Milestone: Boost 1.41.0 | Component: None
  Version: Boost 1.40.0 | Severity: Problem
 Keywords: |
--------------------------+-------------------------------------------------
 The attached patch suppresses some warnings produced by Boost.Bind when
 compiling with MSVC and /W4 (it's already warning free with gcc at -Wall
 -Wextra -pedantic).

 The warnings fixed by this are:

 {{{
 d:\data\boost\trunk\boost/bind/bind.hpp(259) : warning C4100: 'rhs' :
 unreferenced formal parameter
         d:\data\boost\trunk\boost/bind/bind.hpp(260) : while compiling
 class template member function 'bool boost::_bi::list1<A1>::operator
 ==(const boost::_bi::list1<A1> &) const'
         with
         [
             A1=boost::arg<1>
         ]
         d:\data\boost\trunk\boost/bind/bind_template.hpp(345) : see
 reference to class template instantiation 'boost::_bi::list1<A1>' being
 compiled
         with
         [
             A1=boost::arg<1>
         ]
         bind_eq_test.cpp(186) : see reference to class template
 instantiation 'boost::_bi::bind_t<R,F,L>' being compiled
         with
         [
             R=int,
             F=int (__cdecl *)(X),
             L=boost::_bi::list1<boost::arg<1>>
         ]
         bind_eq_test.cpp(383) : see reference to function template
 instantiation 'void test_1<int(__cdecl *)(X)>(F)' being compiled
         with
         [
             F=int (__cdecl *)(X)
         ]
 d:\data\boost\trunk\boost/bind/bind.hpp(339) : warning C4100: 'rhs' :
 unreferenced formal parameter
         d:\data\boost\trunk\boost/bind/bind.hpp(340) : while compiling
 class template member function 'bool boost::_bi::list2<A1,A2>::operator
 ==(const boost::_bi::list2<A1,A2> &) const'
         with
         [
             A1=boost::arg<1>,
             A2=boost::arg<2>
         ]
         d:\data\boost\trunk\boost/bind/bind_template.hpp(345) : see
 reference to class template instantiation 'boost::_bi::list2<A1,A2>' being
 compiled
         with
         [
             A1=boost::arg<1>,
             A2=boost::arg<2>
         ]
         bind_eq_test.cpp(205) : see reference to class template
 instantiation 'boost::_bi::bind_t<R,F,L>' being compiled
         with
         [
             R=int,
             F=int (__cdecl *)(X,X),
             L=boost::_bi::list2<boost::arg<1>,boost::arg<2>>
         ]
         bind_eq_test.cpp(388) : see reference to function template
 instantiation 'void test_2<int(__cdecl *)(X,X)>(F)' being compiled
         with
         [
             F=int (__cdecl *)(X,X)
         ]
 d:\data\boost\trunk\boost/bind/bind.hpp(398) : warning C4100: 'rhs' :
 unreferenced formal parameter
         d:\data\boost\trunk\boost/bind/bind.hpp(399) : while compiling
 class template member function 'bool boost::_bi::list3<A1,A2,A3>::operator
 ==(const boost::_bi::list3<A1,A2,A3> &) const'
         with
         [
             A1=boost::arg<1>,
             A2=boost::arg<2>,
             A3=boost::arg<3>
         ]
         d:\data\boost\trunk\boost/bind/bind_template.hpp(345) : see
 reference to class template instantiation 'boost::_bi::list3<A1,A2,A3>'
 being compiled
         with
         [
             A1=boost::arg<1>,
             A2=boost::arg<2>,
             A3=boost::arg<3>
         ]
         bind_eq_test.cpp(225) : see reference to class template
 instantiation 'boost::_bi::bind_t<R,F,L>' being compiled
         with
         [
             R=int,
             F=int (__cdecl *)(X,X,X),
             L=boost::_bi::list3<boost::arg<1>,boost::arg<2>,boost::arg<3>>
         ]
         bind_eq_test.cpp(393) : see reference to function template
 instantiation 'void test_3<int(__cdecl *)(X,X,X)>(F)' being compiled
         with
         [
             F=int (__cdecl *)(X,X,X)
         ]
 d:\data\boost\trunk\boost/bind/bind.hpp(463) : warning C4100: 'rhs' :
 unreferenced formal parameter
         d:\data\boost\trunk\boost/bind/bind.hpp(464) : while compiling
 class template member function 'bool
 boost::_bi::list4<A1,A2,A3,A4>::operator ==(const
 boost::_bi::list4<A1,A2,A3,A4> &) const'
         with
         [
             A1=boost::arg<1>,
             A2=boost::arg<2>,
             A3=boost::arg<3>,
             A4=boost::arg<4>
         ]
         d:\data\boost\trunk\boost/bind/bind_template.hpp(345) : see
 reference to class template instantiation 'boost::_bi::list4<A1,A2,A3,A4>'
 being compiled
         with
         [
             A1=boost::arg<1>,
             A2=boost::arg<2>,
             A3=boost::arg<3>,
             A4=boost::arg<4>
         ]
         bind_eq_test.cpp(246) : see reference to class template
 instantiation 'boost::_bi::bind_t<R,F,L>' being compiled
         with
         [
             R=int,
             F=int (__cdecl *)(X,X,X,X),
 L=boost::_bi::list4<boost::arg<1>,boost::arg<2>,boost::arg<3>,boost::arg<4>>
         ]
         bind_eq_test.cpp(398) : see reference to function template
 instantiation 'void test_4<int(__cdecl *)(X,X,X,X)>(F)' being compiled
         with
         [
             F=int (__cdecl *)(X,X,X,X)
         ]
 d:\data\boost\trunk\boost/bind/bind.hpp(531) : warning C4100: 'rhs' :
 unreferenced formal parameter
         d:\data\boost\trunk\boost/bind/bind.hpp(532) : while compiling
 class template member function 'bool
 boost::_bi::list5<A1,A2,A3,A4,A5>::operator ==(const
 boost::_bi::list5<A1,A2,A3,A4,A5> &) const'
         with
         [
             A1=boost::arg<1>,
             A2=boost::arg<2>,
             A3=boost::arg<3>,
             A4=boost::arg<4>,
             A5=boost::arg<5>
         ]
         d:\data\boost\trunk\boost/bind/bind_template.hpp(345) : see
 reference to class template instantiation
 'boost::_bi::list5<A1,A2,A3,A4,A5>' being compiled
         with
         [
             A1=boost::arg<1>,
             A2=boost::arg<2>,
             A3=boost::arg<3>,
             A4=boost::arg<4>,
             A5=boost::arg<5>
         ]
         bind_eq_test.cpp(268) : see reference to class template
 instantiation 'boost::_bi::bind_t<R,F,L>' being compiled
         with
         [
             R=int,
             F=int (__cdecl *)(X,X,X,X,X),
 L=boost::_bi::list5<boost::arg<1>,boost::arg<2>,boost::arg<3>,boost::arg<4>,boost::arg<5>>
         ]
         bind_eq_test.cpp(403) : see reference to function template
 instantiation 'void test_5<int(__cdecl *)(X,X,X,X,X)>(F)' being compiled
         with
         [
             F=int (__cdecl *)(X,X,X,X,X)
         ]
 d:\data\boost\trunk\boost/bind/bind.hpp(602) : warning C4100: 'rhs' :
 unreferenced formal parameter
         d:\data\boost\trunk\boost/bind/bind.hpp(603) : while compiling
 class template member function 'bool
 boost::_bi::list6<A1,A2,A3,A4,A5,A6>::operator ==(const
 boost::_bi::list6<A1,A2,A3,A4,A5,A6> &) const'
         with
         [
             A1=boost::arg<1>,
             A2=boost::arg<2>,
             A3=boost::arg<3>,
             A4=boost::arg<4>,
             A5=boost::arg<5>,
             A6=boost::arg<6>
         ]
         d:\data\boost\trunk\boost/bind/bind_template.hpp(345) : see
 reference to class template instantiation
 'boost::_bi::list6<A1,A2,A3,A4,A5,A6>' being compiled
         with
         [
             A1=boost::arg<1>,
             A2=boost::arg<2>,
             A3=boost::arg<3>,
             A4=boost::arg<4>,
             A5=boost::arg<5>,
             A6=boost::arg<6>
         ]
         bind_eq_test.cpp(291) : see reference to class template
 instantiation 'boost::_bi::bind_t<R,F,L>' being compiled
         with
         [
             R=int,
             F=int (__cdecl *)(X,X,X,X,X,X),
 L=boost::_bi::list6<boost::arg<1>,boost::arg<2>,boost::arg<3>,boost::arg<4>,boost::arg<5>,boost::arg<6>>
         ]
         bind_eq_test.cpp(408) : see reference to function template
 instantiation 'void test_6<int(__cdecl *)(X,X,X,X,X,X)>(F)' being compiled
         with
         [
             F=int (__cdecl *)(X,X,X,X,X,X)
         ]
 d:\data\boost\trunk\boost/bind/bind.hpp(676) : warning C4100: 'rhs' :
 unreferenced formal parameter
         d:\data\boost\trunk\boost/bind/bind.hpp(677) : while compiling
 class template member function 'bool
 boost::_bi::list7<A1,A2,A3,A4,A5,A6,A7>::operator ==(const
 boost::_bi::list7<A1,A2,A3,A4,A5,A6,A7> &) const'
         with
         [
             A1=boost::arg<1>,
             A2=boost::arg<2>,
             A3=boost::arg<3>,
             A4=boost::arg<4>,
             A5=boost::arg<5>,
             A6=boost::arg<6>,
             A7=boost::arg<7>
         ]
         d:\data\boost\trunk\boost/bind/bind_template.hpp(345) : see
 reference to class template instantiation
 'boost::_bi::list7<A1,A2,A3,A4,A5,A6,A7>' being compiled
         with
         [
             A1=boost::arg<1>,
             A2=boost::arg<2>,
             A3=boost::arg<3>,
             A4=boost::arg<4>,
             A5=boost::arg<5>,
             A6=boost::arg<6>,
             A7=boost::arg<7>
         ]
         bind_eq_test.cpp(315) : see reference to class template
 instantiation 'boost::_bi::bind_t<R,F,L>' being compiled
         with
         [
             R=int,
             F=int (__cdecl *)(X,X,X,X,X,X,X),
 L=boost::_bi::list7<boost::arg<1>,boost::arg<2>,boost::arg<3>,boost::arg<4>,boost::arg<5>,boost::arg<6>,boost::arg<7>>
         ]
         bind_eq_test.cpp(413) : see reference to function template
 instantiation 'void test_7<int(__cdecl *)(X,X,X,X,X,X,X)>(F)' being
 compiled
         with
         [
             F=int (__cdecl *)(X,X,X,X,X,X,X)
         ]
 d:\data\boost\trunk\boost/bind/bind.hpp(753) : warning C4100: 'rhs' :
 unreferenced formal parameter
         d:\data\boost\trunk\boost/bind/bind.hpp(754) : while compiling
 class template member function 'bool
 boost::_bi::list8<A1,A2,A3,A4,A5,A6,A7,A8>::operator ==(const
 boost::_bi::list8<A1,A2,A3,A4,A5,A6,A7,A8> &) const'
         with
         [
             A1=boost::arg<1>,
             A2=boost::arg<2>,
             A3=boost::arg<3>,
             A4=boost::arg<4>,
             A5=boost::arg<5>,
             A6=boost::arg<6>,
             A7=boost::arg<7>,
             A8=boost::arg<8>
         ]
         d:\data\boost\trunk\boost/bind/bind_template.hpp(345) : see
 reference to class template instantiation
 'boost::_bi::list8<A1,A2,A3,A4,A5,A6,A7,A8>' being compiled
         with
         [
             A1=boost::arg<1>,
             A2=boost::arg<2>,
             A3=boost::arg<3>,
             A4=boost::arg<4>,
             A5=boost::arg<5>,
             A6=boost::arg<6>,
             A7=boost::arg<7>,
             A8=boost::arg<8>
         ]
         bind_eq_test.cpp(340) : see reference to class template
 instantiation 'boost::_bi::bind_t<R,F,L>' being compiled
         with
         [
             R=int,
             F=int (__cdecl *)(X,X,X,X,X,X,X,X),
 L=boost::_bi::list8<boost::arg<1>,boost::arg<2>,boost::arg<3>,boost::arg<4>,boost::arg<5>,boost::arg<6>,boost::arg<7>,boost::arg<8>>
         ]
         bind_eq_test.cpp(418) : see reference to function template
 instantiation 'void test_8<int(__cdecl *)(X,X,X,X,X,X,X,X)>(F)' being
 compiled
         with
         [
             F=int (__cdecl *)(X,X,X,X,X,X,X,X)
         ]
 d:\data\boost\trunk\boost/bind/bind.hpp(833) : warning C4100: 'rhs' :
 unreferenced formal parameter
         d:\data\boost\trunk\boost/bind/bind.hpp(834) : while compiling
 class template member function 'bool
 boost::_bi::list9<A1,A2,A3,A4,A5,A6,A7,A8,A9>::operator ==(const
 boost::_bi::list9<A1,A2,A3,A4,A5,A6,A7,A8,A9> &) const'
         with
         [
             A1=boost::arg<1>,
             A2=boost::arg<2>,
             A3=boost::arg<3>,
             A4=boost::arg<4>,
             A5=boost::arg<5>,
             A6=boost::arg<6>,
             A7=boost::arg<7>,
             A8=boost::arg<8>,
             A9=boost::arg<9>
         ]
         d:\data\boost\trunk\boost/bind/bind_template.hpp(345) : see
 reference to class template instantiation
 'boost::_bi::list9<A1,A2,A3,A4,A5,A6,A7,A8,A9>' being compiled
         with
         [
             A1=boost::arg<1>,
             A2=boost::arg<2>,
             A3=boost::arg<3>,
             A4=boost::arg<4>,
             A5=boost::arg<5>,
             A6=boost::arg<6>,
             A7=boost::arg<7>,
             A8=boost::arg<8>,
             A9=boost::arg<9>
         ]
         bind_eq_test.cpp(366) : see reference to class template
 instantiation 'boost::_bi::bind_t<R,F,L>' being compiled
         with
         [
             R=int,
             F=int (__cdecl *)(X,X,X,X,X,X,X,X,X),
 L=boost::_bi::list9<boost::arg<1>,boost::arg<2>,boost::arg<3>,boost::arg<4>,boost::arg<5>,boost::arg<6>,boost::arg<7>,boost::arg<8>,boost::arg<9>>
         ]
         bind_eq_test.cpp(423) : see reference to function template
 instantiation 'void test_9<int(__cdecl *)(X,X,X,X,X,X,X,X,X)>(F)' being
 compiled
         with
         [
             F=int (__cdecl *)(X,X,X,X,X,X,X,X,X)
         ]

 bind_visit_test.cpp(41) : warning C4100: 't' : unreferenced formal
 parameter
         d:\data\boost\trunk\boost/visit_each.hpp(19) : see reference to
 function template instantiation 'void visitor::operator ()<int(__cdecl
 *)(int,int,int)>(const T &)' being compiled
         with
         [
             T=int (__cdecl *)(int,int,int)
         ]
         d:\data\boost\trunk\boost/bind/bind_template.hpp(333) : see
 reference to function template instantiation 'void
 boost::visit_each<V,int(__cdecl *)(int,int,int)>(Visitor &,const T
 &,long)' being compiled
         with
         [
             V=visitor,
             Visitor=visitor,
             T=int (__cdecl *)(int,int,int)
         ]
         d:\data\boost\trunk\boost/bind/bind.hpp(1237) : see reference to
 function template instantiation 'void
 boost::_bi::bind_t<R,F,L>::accept<V>(V &) const' being compiled
         with
         [
             R=int,
             F=int (__cdecl *)(int,int,int),
 L=boost::_bi::list3<boost::_bi::value<int>,boost::arg<1>,boost::_bi::value<int>>,
             V=visitor
         ]
         d:\data\boost\trunk\boost/visit_each.hpp(25) : see reference to
 function template instantiation 'void
 boost::_bi::visit_each<Visitor,int,int(__cdecl
 *)(int,int,int),boost::_bi::list3<A1,A2,A3>>(V &,const
 boost::_bi::bind_t<R,F,L> &,int)' being compiled
         with
         [
             Visitor=visitor,
             A1=boost::_bi::value<int>,
             A2=boost::arg<1>,
             A3=boost::_bi::value<int>,
             V=visitor,
             R=int,
             F=int (__cdecl *)(int,int,int),
 L=boost::_bi::list3<boost::_bi::value<int>,boost::arg<1>,boost::_bi::value<int>>
         ]
         bind_visit_test.cpp(62) : see reference to function template
 instantiation 'void
 boost::visit_each<visitor,boost::_bi::bind_t<R,F,L>>(Visitor &,const T &)'
 being compiled
         with
         [
             R=int,
             F=int (__cdecl *)(int,int,int),
 L=boost::_bi::list3<boost::_bi::value<int>,boost::arg<1>,boost::_bi::value<int>>,
             Visitor=visitor,
             T=boost::_bi::bind_t<int,int (__cdecl
 *)(int,int,int),boost::_bi::list3<boost::_bi::value<int>,boost::arg<1>,boost::_bi::value<int>>>
         ]
 }}}

 There is one warning not fixed:

 {{{
 d:\data\boost\trunk\boost/bind/bind.hpp(1657) : warning C4180: qualifier
 applied to function type has no meaning; ignored
         d:\data\boost\trunk\boost/bind/bind.hpp(1691) : see reference to
 class template instantiation 'boost::_bi::add_cref<Pm,I>' being compiled
         with
         [
             Pm=boost::shared_ptr<X> (__thiscall Y::* )(void),
             I=1
         ]
         bind_rv_sp_test.cpp(61) : see reference to class template
 instantiation 'boost::_bi::dm_result<Pm,A1>' being compiled
         with
         [
             Pm=boost::shared_ptr<X> (__thiscall Y::* )(void),
             A1=Y *
         ]
 }}}

 Would this be a good place to use add_const, or would a #pragma be better?

 Regards, John.

 PS let me know if you want me to apply these.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3601>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:01 UTC