Suppress a lot of GCC warnings.

[SVN r81830]
This commit is contained in:
John Maddock
2012-12-10 18:39:11 +00:00
parent 13f7c64272
commit 6e9c372d91
22 changed files with 80 additions and 58 deletions

View File

@@ -8,6 +8,12 @@
# the template defined in options_v2.jam.
#
project
: requirements
<toolset>gcc:<cxxflags>-Wno-deprecated-declarations
;
import modules ;
local is_unix = [ modules.peek : UNIX ] ;

View File

@@ -13,6 +13,7 @@
#if defined(__GLIBCXX__) || (defined(__GLIBCPP__) && __GLIBCPP__>=20020514) // GCC >= 3.1.0
# ifdef BOOST_NO_CXX11_STD_UNORDERED
# define BOOST_STD_EXTENSION_NAMESPACE __gnu_cxx
# define _BACKWARD_BACKWARD_WARNING_H 1 /* turn off warnings from the headers below */
# include <ext/hash_set>
# include <ext/hash_map>
# else

View File

@@ -18,7 +18,7 @@ class test_class
{
public:
test_class() {}
test_class(const test_class &other)
test_class(const test_class&)
{
++copy_count;
}

View File

@@ -11,7 +11,7 @@
namespace boost_no_cxx11_auto_declarations {
void check_f(int& x)
void check_f(int&)
{
}

View File

@@ -11,7 +11,7 @@
namespace boost_no_cxx11_auto_multideclarations {
void check_f(int& x, int*& y)
void check_f(int&, int*&)
{
}

View File

@@ -24,8 +24,8 @@ void f(const unsigned long*){}
int test()
{
const char16_t* p;
f(p);
const char16_t p(0);
f(&p);
return 0;
}

View File

@@ -23,8 +23,8 @@ void f(const unsigned long*){}
int test()
{
const char32_t* p;
f(p);
const char32_t p(0);
f(&p);
return 0;
}

View File

@@ -17,6 +17,7 @@ namespace boost_no_cxx11_allocator {
int test()
{
std::pointer_traits<char*>* p = 0;
(void) p;
//std::pointer_safety s = std::relaxed;
//char* (*l_undeclare_reachable)(char *p) = std::undeclare_reachable;
@@ -28,6 +29,9 @@ int test()
std::uses_allocator<int, std::allocator<int> > ua;
std::allocator_traits<std::allocator<int> > at;
(void)aat;
(void)ua;
(void)at;
return 0;
}

View File

@@ -16,7 +16,7 @@ namespace boost_no_cxx11_hdr_array {
int test()
{
std::array<int, 3> a = { 1, 2, 3 };
std::array<int, 3> a = {{ 1, 2, 3 }};
return a.size() == 3 ? 0 : 1;
}

View File

@@ -14,7 +14,7 @@
namespace boost_no_cxx11_hdr_initializer_list {
void foo(const std::initializer_list<const char*>& l)
void foo(const std::initializer_list<const char*>&)
{
}

View File

@@ -26,6 +26,9 @@ int test()
std::hash<std::shared_ptr<int> > h1;
std::hash<std::unique_ptr<int> > h2;
(void)h1;
(void)h2;
return 0;
}

View File

@@ -40,8 +40,8 @@ void baz(F f)
int test()
{
int i;
decltype(i) j;
// quiet_warning(j);
decltype(i) j(0);
quiet_warning(j);
decltype(get_test_class()) k;
#ifndef _MSC_VER
// Although the VC++ decltype is buggy, we none the less enable support,

View File

@@ -46,7 +46,7 @@ struct abstract{ virtual void foo() = 0; };
int test()
{
return is_abstract_test<non_abstract>::value == is_abstract_test<abstract>::value;
return static_cast<bool>(is_abstract_test<non_abstract>::value) == static_cast<bool>(is_abstract_test<abstract>::value);
}
}

View File

@@ -35,7 +35,7 @@ protected:
private:
parser_buf& operator=(const parser_buf&)
{ return *this; };
parser_buf(const parser_buf&){};
parser_buf(const parser_buf&);
};
template<class charT, class traits>
@@ -56,7 +56,7 @@ parser_buf<charT, traits>::seekoff(off_type off, ::std::ios_base::seekdir way, :
int size = this->egptr() - this->eback();
int pos = this->gptr() - this->eback();
charT* g = this->eback();
switch(way)
switch((int)way)
{
case ::std::ios_base::beg:
if((off < 0) || (off > size))

View File

@@ -29,12 +29,12 @@ int test()
{
char c = 0;
#ifndef BOOST_NO_CTYPE_FUNCTIONS
std::isspace(c);
std::isalpha(c);
std::ispunct(c);
(void)std::isspace(c);
(void)std::isalpha(c);
(void)std::ispunct(c);
#endif
(void)std::strlen(&c);
std::clock();
(void)std::clock();
return 0;
}

View File

@@ -19,7 +19,7 @@
namespace boost_no_cxx11_local_class_template_parameters {
template<typename T> struct a { void use() {} };
template<typename T> void f(T x) {}
template<typename T> void f(T) {}
int test() {
class local_class {} local_obj;

View File

@@ -17,6 +17,7 @@ namespace boost_no_templated_iostreams{
int test()
{
std::basic_ostream<char, std::char_traits<char> >& osr = std::cout;
(void)osr;
return 0;
}

View File

@@ -16,7 +16,7 @@ namespace boost_no_typeid
int test()
{
typeid(int);
(void)typeid(int);
return 0;
}

View File

@@ -26,6 +26,7 @@ typename T::type f() {
int test() {
A a = f<B<A> >();
(void)a;
return 0;
}

View File

@@ -12,7 +12,8 @@
namespace boost_no_cxx11_unicode_literals {
void quiet_warning(const char*){}
template <class CharT>
void quiet_warning(const CharT*){}
int test()
{
@@ -20,6 +21,8 @@ int test()
const char16_t* c16 = u"";
const char32_t* c32 = U"";
quiet_warning(c8);
quiet_warning(c16);
quiet_warning(c32);
return 0;
}

View File

@@ -47,6 +47,8 @@ int test()
{
BasicStruct var1{5, 3.2};
AltStruct var2{2, 4.3};
(void) var1;
(void) var2;
IdString id{"SomeName", 4};
return id == get_string() ? 0 : 1;

View File

@@ -60,6 +60,7 @@ int test()
typedef void* pv;
i = user_ns::f(pv());
i = user_ns::f(boost_ns::inner2::X<int>());
(void)i;
return 0;
}