Modify

Opened 8 years ago

Closed 8 years ago

#3601 closed Patches (fixed)

Patch for warning fixes

Reported by: John Maddock Owned by: Peter Dimov
Milestone: Boost 1.41.0 Component: bind
Version: Boost 1.40.0 Severity: Problem
Keywords: Cc:

Description

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.

Attachments (1)

warnings.diff (1.2 KB) - added by John Maddock 8 years ago.

Download all attachments as: .zip

Change History (6)

Changed 8 years ago by John Maddock

Attachment: warnings.diff added

comment:1 Changed 8 years ago by Steven Watanabe

Component: Nonebind
Owner: set to Peter Dimov

comment:2 Changed 8 years ago by Peter Dimov

The patch is fine, feel free to apply. Re C4180: it's caused by a bug in MSVC, which unfortunately remains unfixed (and has even gotten worse).

comment:3 Changed 8 years ago by John Maddock

Resolution: fixed
Status: newclosed

(In [57542]) Warning suppressions in Boost.Bind. Fixes #3601.

comment:4 Changed 8 years ago by Peter Dimov

Resolution: fixed
Status: closedreopened

Reopening since it's only in trunk for now.

comment:5 Changed 8 years ago by Peter Dimov

Resolution: fixed
Status: reopenedclosed

(In [57961]) Merge [57542] to release. Fixes #3601.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Peter Dimov.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.