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

@ -1,13 +1,19 @@
#
# Copyright John Maddock 2008.
# Use, modification and distribution are subject to the
# Boost Software License, Version 1.0. (See accompanying file
# Use, modification and distribution are subject to 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 you need to alter build preferences then set them in
# the template defined in options_v2.jam.
#
project
: requirements
<toolset>gcc:<cxxflags>-Wno-deprecated-declarations
;
import modules ;
local is_unix = [ modules.peek : UNIX ] ;
@ -24,20 +30,20 @@ if $(is_unix)
}
test-suite config
:
:
[ compile config_test_c.c ]
[ run config_test.cpp
[ run config_test.cpp
: #args
: #input-files
: #requirements
<threading>multi
: config_test_threaded
]
[ run config_test.cpp
[ run config_test.cpp
: #args
: #input-files
: #requirements
<threading>single <toolset>msvc:<runtime-link>static <toolset>msvc:<link>static
<threading>single <toolset>msvc:<runtime-link>static <toolset>msvc:<link>static
<target-os>linux:<linkflags>-lpthread
<target-os>linux:<linkflags>-lrt
<toolset>gcc:<linkflags>$(OTHERFLAGS)

View File

@ -1,6 +1,6 @@
// (C) Copyright John Maddock 2001.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// (C) Copyright John Maddock 2001.
// Use, modification and distribution are subject to 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)
// See http://www.boost.org/libs/config for most recent version.
@ -13,10 +13,11 @@
#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
// If we have BOOST_NO_CXX11_STD_UNORDERED *not* defined, then we must
// If we have BOOST_NO_CXX11_STD_UNORDERED *not* defined, then we must
// not include the <ext/*> headers as they clash with the C++0x
// headers. ie in any given translation unit we can include one
// or the other, but not both.

View File

@ -1,7 +1,7 @@
// (C) Copyright Terje Slettebo 2001.
// (C) Copyright John Maddock 2001.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// (C) Copyright John Maddock 2001.
// Use, modification and distribution are subject to 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)
// See http://www.boost.org/libs/config for most recent version.
@ -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,11 +40,11 @@ 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,
#ifndef _MSC_VER
// Although the VC++ decltype is buggy, we none the less enable support,
// so don't test the bugs for now!
baz(get_test_class);
#endif

View File

@ -1,6 +1,6 @@
// (C) Copyright John Maddock and Dave Abrahams 2002.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// (C) Copyright John Maddock and Dave Abrahams 2002.
// Use, modification and distribution are subject to 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)
// See http://www.boost.org/libs/config for most recent version.
@ -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

@ -1,6 +1,6 @@
// (C) Copyright John Maddock 2001.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// (C) Copyright John Maddock 2001.
// Use, modification and distribution are subject to 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)
// See http://www.boost.org/libs/config for most recent version.
@ -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

@ -1,6 +1,6 @@
// (C) Copyright John Maddock 2001.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// (C) Copyright John Maddock 2001.
// Use, modification and distribution are subject to 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)
// See http://www.boost.org/libs/config for most recent version.
@ -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

@ -1,6 +1,6 @@
// (C) Copyright John Maddock 2008.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// (C) Copyright John Maddock 2008.
// Use, modification and distribution are subject to 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)
// See http://www.boost.org/libs/config for most recent version.
@ -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

@ -13,13 +13,13 @@
namespace boost_no_cxx11_unified_initialization_syntax {
struct BasicStruct
struct BasicStruct
{
int x;
double y;
};
struct AltStruct
struct AltStruct
{
public:
AltStruct(int x, double y) : x_{x}, y_{y} {}
@ -27,8 +27,8 @@ private:
int x_;
double y_;
};
struct IdString
struct IdString
{
std::string name;
int identifier;
@ -37,7 +37,7 @@ struct IdString
return identifier == other.identifier && name == other.name;
}
};
IdString get_string()
{
return {"SomeName", 4}; //Note the lack of explicit type.
@ -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

@ -1,6 +1,6 @@
// (C) Copyright John Maddock 2001.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// (C) Copyright John Maddock 2001.
// Use, modification and distribution are subject to 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)
// See http://www.boost.org/libs/config for most recent version.
@ -40,7 +40,7 @@ namespace user_ns
{ return 0; }
template <class T>
int f(T x)
int f(T x)
{
// use this as a workaround:
//using namespace boost;
@ -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;
}