Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60291 - branches/release/libs/utility
From: daniel_james_at_[hidden]
Date: 2010-03-07 07:13:30


Author: danieljames
Date: 2010-03-07 07:13:29 EST (Sun, 07 Mar 2010)
New Revision: 60291
URL: http://svn.boost.org/trac/boost/changeset/60291

Log:
Suppress/fix some msvc and gcc compiler warnings ([57494]).

Properties modified:
   branches/release/libs/utility/ (props changed)
   branches/release/libs/utility/swap.html (props changed)
   branches/release/libs/utility/value_init.htm (props changed)
   branches/release/libs/utility/value_init_test.cpp (contents, props changed)
Text files modified:
   branches/release/libs/utility/base_from_member_test.cpp | 2 +-
   branches/release/libs/utility/binary_test.cpp | 4 ++++
   branches/release/libs/utility/call_traits_test.cpp | 11 +++++++++--
   branches/release/libs/utility/ref_test.cpp | 2 +-
   branches/release/libs/utility/value_init_test.cpp | 6 +++---
   5 files changed, 18 insertions(+), 7 deletions(-)

Modified: branches/release/libs/utility/base_from_member_test.cpp
==============================================================================
--- branches/release/libs/utility/base_from_member_test.cpp (original)
+++ branches/release/libs/utility/base_from_member_test.cpp 2010-03-07 07:13:29 EST (Sun, 07 Mar 2010)
@@ -281,7 +281,7 @@
         }
         else
         {
- return a.second->before( *b.second );
+ return a.second->before( *b.second ) != 0;
         }
     }
 }

Modified: branches/release/libs/utility/binary_test.cpp
==============================================================================
--- branches/release/libs/utility/binary_test.cpp (original)
+++ branches/release/libs/utility/binary_test.cpp 2010-03-07 07:13:29 EST (Sun, 07 Mar 2010)
@@ -11,6 +11,10 @@
 #include <algorithm>
 #include <cstddef>
 
+#ifdef BOOST_MSVC
+#pragma warning(disable:4996) // warning C4996: 'std::equal': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators'
+#endif
+
 /*
 Note: This file tests every single valid bit-grouping on its own, and some
       random combinations of bit-groupings.

Modified: branches/release/libs/utility/call_traits_test.cpp
==============================================================================
--- branches/release/libs/utility/call_traits_test.cpp (original)
+++ branches/release/libs/utility/call_traits_test.cpp 2010-03-07 07:13:29 EST (Sun, 07 Mar 2010)
@@ -21,6 +21,10 @@
 #include <libs/type_traits/test/test.hpp>
 #include <libs/type_traits/test/check_type.hpp>
 
+#ifdef BOOST_MSVC
+#pragma warning(disable:4181) // : warning C4181: qualifier applied to reference type; ignored
+#endif
+
 // a way prevent warnings for unused variables
 template<class T> inline void unused_variable(const T&) {}
 
@@ -52,7 +56,8 @@
    const_reference const_get()const { return v_; }
    // pass value:
    void call(param_type){}
-
+private:
+ contained& operator=(const contained&);
 };
 
 #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
@@ -77,6 +82,8 @@
    reference get() { return v_; }
    const_reference const_get()const { return v_; }
    void call(param_type){}
+private:
+ contained& operator=(const contained&);
 };
 #endif
 
@@ -197,7 +204,7 @@
    bool operator == (const comparible_UDT& v){ return v.i_ == i_; }
 };
 
-int main(int argc, char *argv[ ])
+int main()
 {
    call_traits_checker<comparible_UDT> c1;
    comparible_UDT u;

Modified: branches/release/libs/utility/ref_test.cpp
==============================================================================
--- branches/release/libs/utility/ref_test.cpp (original)
+++ branches/release/libs/utility/ref_test.cpp 2010-03-07 07:13:29 EST (Sun, 07 Mar 2010)
@@ -70,7 +70,7 @@
 
 struct copy_counter {
   static int count_;
- copy_counter(copy_counter const& other) {
+ copy_counter(copy_counter const& /*other*/) {
     ++count_;
   }
   copy_counter() {}

Modified: branches/release/libs/utility/value_init_test.cpp
==============================================================================
--- branches/release/libs/utility/value_init_test.cpp (original)
+++ branches/release/libs/utility/value_init_test.cpp 2010-03-07 07:13:29 EST (Sun, 07 Mar 2010)
@@ -29,9 +29,9 @@
 //
 struct POD
 {
- POD () : c(0), i(0), f(0) {}
+ POD () : f(0), c(0), i(0){}
 
- POD ( char c_, int i_, float f_ ) : c(c_), i(i_), f(f_) {}
+ POD ( char c_, int i_, float f_ ) : f(f_), c(c_), i(i_) {}
 
   friend std::ostream& operator << ( std::ostream& os, POD const& pod )
     { return os << '(' << pod.c << ',' << pod.i << ',' << pod.f << ')' ; }
@@ -291,7 +291,7 @@
 {
   BOOST_CHECK ( test( 0,1234 ) ) ;
   BOOST_CHECK ( test( 0.0,12.34 ) ) ;
- BOOST_CHECK ( test( POD(0,0,0.0), POD('a',1234,56.78) ) ) ;
+ BOOST_CHECK ( test( POD(0,0,0.0), POD('a',1234,56.78f) ) ) ;
   BOOST_CHECK ( test( NonPOD( std::string() ), NonPOD( std::string("something") ) ) ) ;
 
   NonPOD NonPOD_object( std::string("NonPOD_object") );


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk