mirror of
https://github.com/boostorg/config.git
synced 2025-07-31 12:57:16 +02:00
Suppress a lot of GCC warnings.
[SVN r81830]
This commit is contained in:
@@ -1,13 +1,19 @@
|
|||||||
#
|
#
|
||||||
# Copyright John Maddock 2008.
|
# Copyright John Maddock 2008.
|
||||||
# Use, modification and distribution are subject to the
|
# Use, modification and distribution are subject to the
|
||||||
# Boost Software License, Version 1.0. (See accompanying file
|
# Boost Software License, Version 1.0. (See accompanying file
|
||||||
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
# 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
|
# If you need to alter build preferences then set them in
|
||||||
# the template defined in options_v2.jam.
|
# the template defined in options_v2.jam.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
project
|
||||||
|
: requirements
|
||||||
|
<toolset>gcc:<cxxflags>-Wno-deprecated-declarations
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
import modules ;
|
import modules ;
|
||||||
|
|
||||||
local is_unix = [ modules.peek : UNIX ] ;
|
local is_unix = [ modules.peek : UNIX ] ;
|
||||||
@@ -24,20 +30,20 @@ if $(is_unix)
|
|||||||
}
|
}
|
||||||
|
|
||||||
test-suite config
|
test-suite config
|
||||||
:
|
:
|
||||||
[ compile config_test_c.c ]
|
[ compile config_test_c.c ]
|
||||||
[ run config_test.cpp
|
[ run config_test.cpp
|
||||||
: #args
|
: #args
|
||||||
: #input-files
|
: #input-files
|
||||||
: #requirements
|
: #requirements
|
||||||
<threading>multi
|
<threading>multi
|
||||||
: config_test_threaded
|
: config_test_threaded
|
||||||
]
|
]
|
||||||
[ run config_test.cpp
|
[ run config_test.cpp
|
||||||
: #args
|
: #args
|
||||||
: #input-files
|
: #input-files
|
||||||
: #requirements
|
: #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>-lpthread
|
||||||
<target-os>linux:<linkflags>-lrt
|
<target-os>linux:<linkflags>-lrt
|
||||||
<toolset>gcc:<linkflags>$(OTHERFLAGS)
|
<toolset>gcc:<linkflags>$(OTHERFLAGS)
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// (C) Copyright John Maddock 2001.
|
// (C) Copyright John Maddock 2001.
|
||||||
// Use, modification and distribution are subject to the
|
// Use, modification and distribution are subject to the
|
||||||
// Boost Software License, Version 1.0. (See accompanying file
|
// Boost Software License, Version 1.0. (See accompanying file
|
||||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
// 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.
|
// 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
|
#if defined(__GLIBCXX__) || (defined(__GLIBCPP__) && __GLIBCPP__>=20020514) // GCC >= 3.1.0
|
||||||
# ifdef BOOST_NO_CXX11_STD_UNORDERED
|
# ifdef BOOST_NO_CXX11_STD_UNORDERED
|
||||||
# define BOOST_STD_EXTENSION_NAMESPACE __gnu_cxx
|
# 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_set>
|
||||||
# include <ext/hash_map>
|
# include <ext/hash_map>
|
||||||
# else
|
# 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
|
// not include the <ext/*> headers as they clash with the C++0x
|
||||||
// headers. ie in any given translation unit we can include one
|
// headers. ie in any given translation unit we can include one
|
||||||
// or the other, but not both.
|
// or the other, but not both.
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
// (C) Copyright Terje Slettebo 2001.
|
// (C) Copyright Terje Slettebo 2001.
|
||||||
// (C) Copyright John Maddock 2001.
|
// (C) Copyright John Maddock 2001.
|
||||||
// Use, modification and distribution are subject to the
|
// Use, modification and distribution are subject to the
|
||||||
// Boost Software License, Version 1.0. (See accompanying file
|
// Boost Software License, Version 1.0. (See accompanying file
|
||||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
// 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.
|
// See http://www.boost.org/libs/config for most recent version.
|
||||||
@@ -18,7 +18,7 @@ class test_class
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
test_class() {}
|
test_class() {}
|
||||||
test_class(const test_class &other)
|
test_class(const test_class&)
|
||||||
{
|
{
|
||||||
++copy_count;
|
++copy_count;
|
||||||
}
|
}
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
namespace boost_no_cxx11_auto_declarations {
|
namespace boost_no_cxx11_auto_declarations {
|
||||||
|
|
||||||
void check_f(int& x)
|
void check_f(int&)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
namespace boost_no_cxx11_auto_multideclarations {
|
namespace boost_no_cxx11_auto_multideclarations {
|
||||||
|
|
||||||
void check_f(int& x, int*& y)
|
void check_f(int&, int*&)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -24,8 +24,8 @@ void f(const unsigned long*){}
|
|||||||
|
|
||||||
int test()
|
int test()
|
||||||
{
|
{
|
||||||
const char16_t* p;
|
const char16_t p(0);
|
||||||
f(p);
|
f(&p);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -23,8 +23,8 @@ void f(const unsigned long*){}
|
|||||||
|
|
||||||
int test()
|
int test()
|
||||||
{
|
{
|
||||||
const char32_t* p;
|
const char32_t p(0);
|
||||||
f(p);
|
f(&p);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -17,6 +17,7 @@ namespace boost_no_cxx11_allocator {
|
|||||||
int test()
|
int test()
|
||||||
{
|
{
|
||||||
std::pointer_traits<char*>* p = 0;
|
std::pointer_traits<char*>* p = 0;
|
||||||
|
(void) p;
|
||||||
//std::pointer_safety s = std::relaxed;
|
//std::pointer_safety s = std::relaxed;
|
||||||
|
|
||||||
//char* (*l_undeclare_reachable)(char *p) = std::undeclare_reachable;
|
//char* (*l_undeclare_reachable)(char *p) = std::undeclare_reachable;
|
||||||
@@ -28,6 +29,9 @@ int test()
|
|||||||
std::uses_allocator<int, std::allocator<int> > ua;
|
std::uses_allocator<int, std::allocator<int> > ua;
|
||||||
std::allocator_traits<std::allocator<int> > at;
|
std::allocator_traits<std::allocator<int> > at;
|
||||||
|
|
||||||
|
(void)aat;
|
||||||
|
(void)ua;
|
||||||
|
(void)at;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -16,7 +16,7 @@ namespace boost_no_cxx11_hdr_array {
|
|||||||
|
|
||||||
int test()
|
int test()
|
||||||
{
|
{
|
||||||
std::array<int, 3> a = { 1, 2, 3 };
|
std::array<int, 3> a = {{ 1, 2, 3 }};
|
||||||
return a.size() == 3 ? 0 : 1;
|
return a.size() == 3 ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
namespace boost_no_cxx11_hdr_initializer_list {
|
namespace boost_no_cxx11_hdr_initializer_list {
|
||||||
|
|
||||||
void foo(const std::initializer_list<const char*>& l)
|
void foo(const std::initializer_list<const char*>&)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -26,6 +26,9 @@ int test()
|
|||||||
std::hash<std::shared_ptr<int> > h1;
|
std::hash<std::shared_ptr<int> > h1;
|
||||||
std::hash<std::unique_ptr<int> > h2;
|
std::hash<std::unique_ptr<int> > h2;
|
||||||
|
|
||||||
|
(void)h1;
|
||||||
|
(void)h2;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -40,11 +40,11 @@ void baz(F f)
|
|||||||
int test()
|
int test()
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
decltype(i) j;
|
decltype(i) j(0);
|
||||||
// quiet_warning(j);
|
quiet_warning(j);
|
||||||
decltype(get_test_class()) k;
|
decltype(get_test_class()) k;
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
// Although the VC++ decltype is buggy, we none the less enable support,
|
// Although the VC++ decltype is buggy, we none the less enable support,
|
||||||
// so don't test the bugs for now!
|
// so don't test the bugs for now!
|
||||||
baz(get_test_class);
|
baz(get_test_class);
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// (C) Copyright John Maddock and Dave Abrahams 2002.
|
// (C) Copyright John Maddock and Dave Abrahams 2002.
|
||||||
// Use, modification and distribution are subject to the
|
// Use, modification and distribution are subject to the
|
||||||
// Boost Software License, Version 1.0. (See accompanying file
|
// Boost Software License, Version 1.0. (See accompanying file
|
||||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
// 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.
|
// See http://www.boost.org/libs/config for most recent version.
|
||||||
@@ -46,7 +46,7 @@ struct abstract{ virtual void foo() = 0; };
|
|||||||
|
|
||||||
int test()
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// (C) Copyright John Maddock 2001.
|
// (C) Copyright John Maddock 2001.
|
||||||
// Use, modification and distribution are subject to the
|
// Use, modification and distribution are subject to the
|
||||||
// Boost Software License, Version 1.0. (See accompanying file
|
// Boost Software License, Version 1.0. (See accompanying file
|
||||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
// 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.
|
// See http://www.boost.org/libs/config for most recent version.
|
||||||
@@ -35,7 +35,7 @@ protected:
|
|||||||
private:
|
private:
|
||||||
parser_buf& operator=(const parser_buf&)
|
parser_buf& operator=(const parser_buf&)
|
||||||
{ return *this; };
|
{ return *this; };
|
||||||
parser_buf(const parser_buf&){};
|
parser_buf(const parser_buf&);
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class charT, class traits>
|
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 size = this->egptr() - this->eback();
|
||||||
int pos = this->gptr() - this->eback();
|
int pos = this->gptr() - this->eback();
|
||||||
charT* g = this->eback();
|
charT* g = this->eback();
|
||||||
switch(way)
|
switch((int)way)
|
||||||
{
|
{
|
||||||
case ::std::ios_base::beg:
|
case ::std::ios_base::beg:
|
||||||
if((off < 0) || (off > size))
|
if((off < 0) || (off > size))
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// (C) Copyright John Maddock 2001.
|
// (C) Copyright John Maddock 2001.
|
||||||
// Use, modification and distribution are subject to the
|
// Use, modification and distribution are subject to the
|
||||||
// Boost Software License, Version 1.0. (See accompanying file
|
// Boost Software License, Version 1.0. (See accompanying file
|
||||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
// 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.
|
// See http://www.boost.org/libs/config for most recent version.
|
||||||
@@ -29,12 +29,12 @@ int test()
|
|||||||
{
|
{
|
||||||
char c = 0;
|
char c = 0;
|
||||||
#ifndef BOOST_NO_CTYPE_FUNCTIONS
|
#ifndef BOOST_NO_CTYPE_FUNCTIONS
|
||||||
std::isspace(c);
|
(void)std::isspace(c);
|
||||||
std::isalpha(c);
|
(void)std::isalpha(c);
|
||||||
std::ispunct(c);
|
(void)std::ispunct(c);
|
||||||
#endif
|
#endif
|
||||||
(void)std::strlen(&c);
|
(void)std::strlen(&c);
|
||||||
std::clock();
|
(void)std::clock();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -19,7 +19,7 @@
|
|||||||
namespace boost_no_cxx11_local_class_template_parameters {
|
namespace boost_no_cxx11_local_class_template_parameters {
|
||||||
|
|
||||||
template<typename T> struct a { void use() {} };
|
template<typename T> struct a { void use() {} };
|
||||||
template<typename T> void f(T x) {}
|
template<typename T> void f(T) {}
|
||||||
|
|
||||||
int test() {
|
int test() {
|
||||||
class local_class {} local_obj;
|
class local_class {} local_obj;
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// (C) Copyright John Maddock 2008.
|
// (C) Copyright John Maddock 2008.
|
||||||
// Use, modification and distribution are subject to the
|
// Use, modification and distribution are subject to the
|
||||||
// Boost Software License, Version 1.0. (See accompanying file
|
// Boost Software License, Version 1.0. (See accompanying file
|
||||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
// 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.
|
// See http://www.boost.org/libs/config for most recent version.
|
||||||
@@ -17,6 +17,7 @@ namespace boost_no_templated_iostreams{
|
|||||||
int test()
|
int test()
|
||||||
{
|
{
|
||||||
std::basic_ostream<char, std::char_traits<char> >& osr = std::cout;
|
std::basic_ostream<char, std::char_traits<char> >& osr = std::cout;
|
||||||
|
(void)osr;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -16,7 +16,7 @@ namespace boost_no_typeid
|
|||||||
|
|
||||||
int test()
|
int test()
|
||||||
{
|
{
|
||||||
typeid(int);
|
(void)typeid(int);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -26,6 +26,7 @@ typename T::type f() {
|
|||||||
|
|
||||||
int test() {
|
int test() {
|
||||||
A a = f<B<A> >();
|
A a = f<B<A> >();
|
||||||
|
(void)a;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -12,7 +12,8 @@
|
|||||||
|
|
||||||
namespace boost_no_cxx11_unicode_literals {
|
namespace boost_no_cxx11_unicode_literals {
|
||||||
|
|
||||||
void quiet_warning(const char*){}
|
template <class CharT>
|
||||||
|
void quiet_warning(const CharT*){}
|
||||||
|
|
||||||
int test()
|
int test()
|
||||||
{
|
{
|
||||||
@@ -20,6 +21,8 @@ int test()
|
|||||||
const char16_t* c16 = u"";
|
const char16_t* c16 = u"";
|
||||||
const char32_t* c32 = U"";
|
const char32_t* c32 = U"";
|
||||||
quiet_warning(c8);
|
quiet_warning(c8);
|
||||||
|
quiet_warning(c16);
|
||||||
|
quiet_warning(c32);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -13,13 +13,13 @@
|
|||||||
|
|
||||||
namespace boost_no_cxx11_unified_initialization_syntax {
|
namespace boost_no_cxx11_unified_initialization_syntax {
|
||||||
|
|
||||||
struct BasicStruct
|
struct BasicStruct
|
||||||
{
|
{
|
||||||
int x;
|
int x;
|
||||||
double y;
|
double y;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct AltStruct
|
struct AltStruct
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AltStruct(int x, double y) : x_{x}, y_{y} {}
|
AltStruct(int x, double y) : x_{x}, y_{y} {}
|
||||||
@@ -27,8 +27,8 @@ private:
|
|||||||
int x_;
|
int x_;
|
||||||
double y_;
|
double y_;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct IdString
|
struct IdString
|
||||||
{
|
{
|
||||||
std::string name;
|
std::string name;
|
||||||
int identifier;
|
int identifier;
|
||||||
@@ -37,7 +37,7 @@ struct IdString
|
|||||||
return identifier == other.identifier && name == other.name;
|
return identifier == other.identifier && name == other.name;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
IdString get_string()
|
IdString get_string()
|
||||||
{
|
{
|
||||||
return {"SomeName", 4}; //Note the lack of explicit type.
|
return {"SomeName", 4}; //Note the lack of explicit type.
|
||||||
@@ -47,6 +47,8 @@ int test()
|
|||||||
{
|
{
|
||||||
BasicStruct var1{5, 3.2};
|
BasicStruct var1{5, 3.2};
|
||||||
AltStruct var2{2, 4.3};
|
AltStruct var2{2, 4.3};
|
||||||
|
(void) var1;
|
||||||
|
(void) var2;
|
||||||
|
|
||||||
IdString id{"SomeName", 4};
|
IdString id{"SomeName", 4};
|
||||||
return id == get_string() ? 0 : 1;
|
return id == get_string() ? 0 : 1;
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// (C) Copyright John Maddock 2001.
|
// (C) Copyright John Maddock 2001.
|
||||||
// Use, modification and distribution are subject to the
|
// Use, modification and distribution are subject to the
|
||||||
// Boost Software License, Version 1.0. (See accompanying file
|
// Boost Software License, Version 1.0. (See accompanying file
|
||||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
// 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.
|
// See http://www.boost.org/libs/config for most recent version.
|
||||||
@@ -40,7 +40,7 @@ namespace user_ns
|
|||||||
{ return 0; }
|
{ return 0; }
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
int f(T x)
|
int f(T x)
|
||||||
{
|
{
|
||||||
// use this as a workaround:
|
// use this as a workaround:
|
||||||
//using namespace boost;
|
//using namespace boost;
|
||||||
@@ -60,6 +60,7 @@ int test()
|
|||||||
typedef void* pv;
|
typedef void* pv;
|
||||||
i = user_ns::f(pv());
|
i = user_ns::f(pv());
|
||||||
i = user_ns::f(boost_ns::inner2::X<int>());
|
i = user_ns::f(boost_ns::inner2::X<int>());
|
||||||
|
(void)i;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user