Boost logo

Boost-Commit :

From: daniel_james_at_[hidden]
Date: 2007-08-14 05:55:31


Author: danieljames
Date: 2007-08-14 05:55:30 EDT (Tue, 14 Aug 2007)
New Revision: 38648
URL: http://svn.boost.org/trac/boost/changeset/38648

Log:
Run most of the unordered container tests (not the exception tests) on warning
level 4 on Visual C++.

Text files modified:
   sandbox/unordered/libs/unordered/test/container/Jamfile.v2 | 1 +
   sandbox/unordered/libs/unordered/test/container/compile_tests.hpp | 10 ++++++++++
   sandbox/unordered/libs/unordered/test/helpers/allocator.hpp | 16 +++++++++++++---
   sandbox/unordered/libs/unordered/test/helpers/generators.hpp | 2 +-
   sandbox/unordered/libs/unordered/test/helpers/invariants.hpp | 9 +++++++++
   sandbox/unordered/libs/unordered/test/objects/minimal.hpp | 9 +++++++++
   sandbox/unordered/libs/unordered/test/unordered/Jamfile.v2 | 1 +
   sandbox/unordered/libs/unordered/test/unordered/compile_tests.cpp | 10 ++++++++++
   sandbox/unordered/libs/unordered/test/unordered/load_factor_tests.cpp | 10 ++++++++++
   sandbox/unordered/libs/unordered/test/unordered/unnecessary_copy_tests.cpp | 6 +++---
   10 files changed, 67 insertions(+), 7 deletions(-)

Modified: sandbox/unordered/libs/unordered/test/container/Jamfile.v2
==============================================================================
--- sandbox/unordered/libs/unordered/test/container/Jamfile.v2 (original)
+++ sandbox/unordered/libs/unordered/test/container/Jamfile.v2 2007-08-14 05:55:30 EDT (Tue, 14 Aug 2007)
@@ -9,6 +9,7 @@
     : requirements
         <toolset>intel-linux:"<cxxflags>-strict_ansi -cxxlib-icc"
         <toolset>gcc:<cxxflags>-Wsign-promo
+ <toolset>msvc:<cxxflags>/W4
     ;
 
 test-suite container-tests

Modified: sandbox/unordered/libs/unordered/test/container/compile_tests.hpp
==============================================================================
--- sandbox/unordered/libs/unordered/test/container/compile_tests.hpp (original)
+++ sandbox/unordered/libs/unordered/test/container/compile_tests.hpp 2007-08-14 05:55:30 EDT (Tue, 14 Aug 2007)
@@ -3,7 +3,17 @@
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
+#if defined(BOOST_MSVC)
+#pragma warning(push)
+#pragma warning(disable:4100) // unreferenced formal parameter
+#endif
+
 #include <boost/concept_check.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(pop)
+#endif
+
 #include <boost/mpl/assert.hpp>
 #include <boost/mpl/bool.hpp>
 #include <boost/type_traits/is_same.hpp>

Modified: sandbox/unordered/libs/unordered/test/helpers/allocator.hpp
==============================================================================
--- sandbox/unordered/libs/unordered/test/helpers/allocator.hpp (original)
+++ sandbox/unordered/libs/unordered/test/helpers/allocator.hpp 2007-08-14 05:55:30 EDT (Tue, 14 Aug 2007)
@@ -10,6 +10,11 @@
 #include <cstdlib>
 #include <boost/limits.hpp>
 
+#if defined(BOOST_MSVC)
+#pragma warning(push)
+#pragma warning(disable:4100) // unreferenced formal parameter
+#endif
+
 namespace test
 {
     template <class T>
@@ -26,8 +31,8 @@
         template <class U> struct rebind { typedef malloc_allocator<U> other; };
 
         malloc_allocator() {}
- template <class Y> malloc_allocator(malloc_allocator<Y> const& x) {}
- malloc_allocator(malloc_allocator const& x) {}
+ template <class Y> malloc_allocator(malloc_allocator<Y> const&) {}
+ malloc_allocator(malloc_allocator const&) {}
 
         pointer address(reference r) { return &r; }
         const_pointer address(const_reference r) { return &r; }
@@ -37,7 +42,7 @@
         }
 
         pointer allocate(size_type n, const_pointer u) { return allocate(n); }
- void deallocate(pointer p, size_type n) { free(p); }
+ void deallocate(pointer p, size_type) { free(p); }
         void construct(pointer p, T const& t) { new(p) T(t); }
         void destroy(pointer p) { p->~T(); }
 
@@ -59,4 +64,9 @@
     };
 }
 
+#if defined(BOOST_MSVC)
+#pragma warning(pop)
+#pragma warning(disable:4100) // unreferenced formal parameter
+#endif
+
 #endif

Modified: sandbox/unordered/libs/unordered/test/helpers/generators.hpp
==============================================================================
--- sandbox/unordered/libs/unordered/test/helpers/generators.hpp (original)
+++ sandbox/unordered/libs/unordered/test/helpers/generators.hpp 2007-08-14 05:55:30 EDT (Tue, 14 Aug 2007)
@@ -59,7 +59,7 @@
     inline signed char generate(signed char const*)
     {
         using namespace std;
- return rand();
+ return static_cast<signed char>(rand());
     }
 
     inline std::string generate(std::string const*)

Modified: sandbox/unordered/libs/unordered/test/helpers/invariants.hpp
==============================================================================
--- sandbox/unordered/libs/unordered/test/helpers/invariants.hpp (original)
+++ sandbox/unordered/libs/unordered/test/helpers/invariants.hpp 2007-08-14 05:55:30 EDT (Tue, 14 Aug 2007)
@@ -15,6 +15,11 @@
 #include "./helpers.hpp"
 #include "./allocator.hpp"
 
+#if defined(BOOST_MSVC)
+#pragma warning(push)
+#pragma warning(disable:4127) // conditional expression is constant
+#endif
+
 namespace test
 {
     template <class X>
@@ -92,5 +97,9 @@
     }
 }
 
+#if defined(BOOST_MSVC)
+#pragma warning(pop)
+#endif
+
 #endif
 

Modified: sandbox/unordered/libs/unordered/test/objects/minimal.hpp
==============================================================================
--- sandbox/unordered/libs/unordered/test/objects/minimal.hpp (original)
+++ sandbox/unordered/libs/unordered/test/objects/minimal.hpp 2007-08-14 05:55:30 EDT (Tue, 14 Aug 2007)
@@ -8,6 +8,11 @@
 
 #include <cstddef>
 
+#if defined(BOOST_MSVC)
+#pragma warning(push)
+#pragma warning(disable:4100) // unreferenced formal parameter
+#endif
+
 namespace test
 {
 namespace minimal
@@ -226,4 +231,8 @@
 }
 }
 
+#if defined(BOOST_MSVC)
+#pragma warning(pop)
+#endif
+
 #endif

Modified: sandbox/unordered/libs/unordered/test/unordered/Jamfile.v2
==============================================================================
--- sandbox/unordered/libs/unordered/test/unordered/Jamfile.v2 (original)
+++ sandbox/unordered/libs/unordered/test/unordered/Jamfile.v2 2007-08-14 05:55:30 EDT (Tue, 14 Aug 2007)
@@ -9,6 +9,7 @@
     : requirements
         <toolset>intel-linux:"<cxxflags>-strict_ansi -cxxlib-icc"
         <toolset>gcc:<cxxflags>-Wsign-promo
+ <toolset>msvc:<cxxflags>/W4
     ;
 
 test-suite unordered-tests

Modified: sandbox/unordered/libs/unordered/test/unordered/compile_tests.cpp
==============================================================================
--- sandbox/unordered/libs/unordered/test/unordered/compile_tests.cpp (original)
+++ sandbox/unordered/libs/unordered/test/unordered/compile_tests.cpp 2007-08-14 05:55:30 EDT (Tue, 14 Aug 2007)
@@ -6,7 +6,17 @@
 #include <boost/unordered_set.hpp>
 #include <boost/unordered_map.hpp>
 
+#if defined(BOOST_MSVC)
+#pragma warning(push)
+#pragma warning(disable:4100) // unreferenced formal parameter
+#endif
+
 #include <boost/concept_check.hpp>
+
+#if defined(BOOST_MSVC)
+#pragma warning(pop)
+#endif
+
 #include <boost/mpl/assert.hpp>
 #include <boost/iterator/iterator_traits.hpp>
 #include "../helpers/check_return_type.hpp"

Modified: sandbox/unordered/libs/unordered/test/unordered/load_factor_tests.cpp
==============================================================================
--- sandbox/unordered/libs/unordered/test/unordered/load_factor_tests.cpp (original)
+++ sandbox/unordered/libs/unordered/test/unordered/load_factor_tests.cpp 2007-08-14 05:55:30 EDT (Tue, 14 Aug 2007)
@@ -9,6 +9,11 @@
 #include <boost/limits.hpp>
 #include "../helpers/random_values.hpp"
 
+#if defined(BOOST_MSVC)
+#pragma warning(push)
+#pragma warning(disable:4127) // conditional expression is constant
+#endif
+
 template <class X>
 void load_factor_tests(X* = 0)
 {
@@ -70,3 +75,8 @@
 
     return boost::report_errors();
 }
+
+#if defined(BOOST_MSVC)
+#pragma warning(pop)
+#pragma warning(disable:4127) // conditional expression is constant
+#endif

Modified: sandbox/unordered/libs/unordered/test/unordered/unnecessary_copy_tests.cpp
==============================================================================
--- sandbox/unordered/libs/unordered/test/unordered/unnecessary_copy_tests.cpp (original)
+++ sandbox/unordered/libs/unordered/test/unordered/unnecessary_copy_tests.cpp 2007-08-14 05:55:30 EDT (Tue, 14 Aug 2007)
@@ -11,7 +11,7 @@
 {
     static int count;
     count_copies() { ++count; }
- count_copies(count_copies const& x) { ++count; }
+ count_copies(count_copies const&) { ++count; }
 private:
     count_copies& operator=(count_copies const&);
 };
@@ -20,7 +20,7 @@
 namespace boost {
 #endif
 
-std::size_t hash_value(count_copies const& x) {
+std::size_t hash_value(count_copies const&) {
     return 0;
 }
 
@@ -28,7 +28,7 @@
 }
 #endif
 
-bool operator==(count_copies const& x, count_copies const& y) {
+bool operator==(count_copies const&, count_copies const&) {
     return true;
 }
 


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