Suppress more GCC warnings.

Fix GCC compile failure in lambda test case.
This commit is contained in:
jzmaddock
2014-06-10 18:22:10 +01:00
parent dad7bc5b30
commit f0c99f7b7f
6 changed files with 36 additions and 14 deletions

View File

@@ -12,6 +12,12 @@
#include <memory> #include <memory>
#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)))
# define BOOST_UNUSED_ATTRIBUTE __attribute__((unused))
#else
# define BOOST_UNUSED_ATTRIBUTE
#endif
namespace boost_has_partial_std_allocator{ namespace boost_has_partial_std_allocator{
// //
@@ -23,12 +29,12 @@ int test_allocator(const T& i)
{ {
typedef std::allocator<int> alloc1_t; typedef std::allocator<int> alloc1_t;
typedef typename alloc1_t::size_type size_type; typedef typename alloc1_t::size_type size_type;
typedef typename alloc1_t::difference_type difference_type; typedef typename alloc1_t::difference_type difference_type BOOST_UNUSED_ATTRIBUTE;
typedef typename alloc1_t::pointer pointer; typedef typename alloc1_t::pointer pointer;
typedef typename alloc1_t::const_pointer const_pointer; typedef typename alloc1_t::const_pointer const_pointer;
typedef typename alloc1_t::reference reference; typedef typename alloc1_t::reference reference;
typedef typename alloc1_t::const_reference const_reference; typedef typename alloc1_t::const_reference const_reference;
typedef typename alloc1_t::value_type value_type; typedef typename alloc1_t::value_type value_type BOOST_UNUSED_ATTRIBUTE;
alloc1_t a1; alloc1_t a1;
@@ -55,8 +61,5 @@ int test()
} }
#undef BOOST_UNUSED_ATTRIBUTE

View File

@@ -25,6 +25,7 @@ int test()
{ {
std::memory_order m = static_cast<std::memory_order>(std::memory_order_relaxed | std::memory_order_consume | std::memory_order_acquire | std::memory_order_release std::memory_order m = static_cast<std::memory_order>(std::memory_order_relaxed | std::memory_order_consume | std::memory_order_acquire | std::memory_order_release
| std::memory_order_acq_rel | std::memory_order_seq_cst); | std::memory_order_acq_rel | std::memory_order_seq_cst);
(void)m;
std::atomic<int> a1; std::atomic<int> a1;
std::atomic<unsigned> a2; std::atomic<unsigned> a2;

View File

@@ -36,8 +36,8 @@ int test()
#endif #endif
int i; int i;
fexcept_t fe; has_fexcept_t fe;
fenv_t env; has_fenv_t env;
i = feclearexcept(FE_ALL_EXCEPT); i = feclearexcept(FE_ALL_EXCEPT);
i += fetestexcept(FE_ALL_EXCEPT); // All flags should be zero i += fetestexcept(FE_ALL_EXCEPT); // All flags should be zero

View File

@@ -44,12 +44,19 @@ struct is_int<int>
static const bool value = true; static const bool value = true;
}; };
#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)))
# define BOOST_UNUSED_ATTRIBUTE __attribute__((unused))
#else
# define BOOST_UNUSED_ATTRIBUTE
#endif
int test() int test()
{ {
typedef int a1[ice_or< is_int<int>::value, is_int<UDT>::value>::value ? 1 : -1]; typedef int a1[ice_or< is_int<int>::value, is_int<UDT>::value>::value ? 1 : -1] BOOST_UNUSED_ATTRIBUTE;
return 0; return 0;
} }
} }
#undef BOOST_UNUSED_ATTRIBUTE

View File

@@ -16,9 +16,14 @@
namespace boost_no_cxx11_lambdas { namespace boost_no_cxx11_lambdas {
template <class Func>
void f(Func)
{
}
int test() int test()
{ {
(void)[](){}; f([](){});
return 0; return 0;
} }

View File

@@ -18,17 +18,23 @@
namespace boost_no_std_allocator{ namespace boost_no_std_allocator{
#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)))
# define BOOST_UNUSED_ATTRIBUTE __attribute__((unused))
#else
# define BOOST_UNUSED_ATTRIBUTE
#endif
template <class T> template <class T>
int test_allocator(const T& i) int test_allocator(const T& i)
{ {
typedef std::allocator<int> alloc1_t; typedef std::allocator<int> alloc1_t;
typedef typename alloc1_t::size_type size_type; typedef typename alloc1_t::size_type size_type;
typedef typename alloc1_t::difference_type difference_type; typedef typename alloc1_t::difference_type difference_type BOOST_UNUSED_ATTRIBUTE;
typedef typename alloc1_t::pointer pointer; typedef typename alloc1_t::pointer pointer;
typedef typename alloc1_t::const_pointer const_pointer; typedef typename alloc1_t::const_pointer const_pointer;
typedef typename alloc1_t::reference reference; typedef typename alloc1_t::reference reference;
typedef typename alloc1_t::const_reference const_reference; typedef typename alloc1_t::const_reference const_reference;
typedef typename alloc1_t::value_type value_type; typedef typename alloc1_t::value_type value_type BOOST_UNUSED_ATTRIBUTE;
typedef typename alloc1_t::BOOST_NESTED_TEMPLATE rebind<double> binder_t; typedef typename alloc1_t::BOOST_NESTED_TEMPLATE rebind<double> binder_t;
typedef typename binder_t::other alloc2_t; typedef typename binder_t::other alloc2_t;
@@ -66,7 +72,7 @@ int test()
} }
#undef BOOST_UNUSED_ATTRIBUTE