diff --git a/include/boost/python/class.hpp b/include/boost/python/class.hpp index f43b615a..70ca6d01 100644 --- a/include/boost/python/class.hpp +++ b/include/boost/python/class.hpp @@ -140,9 +140,9 @@ namespace detail // https://svn.boost.org/trac/boost/ticket/5803 //typedef typename assertion > >::failed test0; # if !BOOST_WORKAROUND(__MWERKS__, <= 0x2407) - typedef typename assertion >::failed test1; + typedef typename assertion >::failed test1 BOOST_ATTRIBUTE_UNUSED; # endif - typedef typename assertion >::failed test2; + typedef typename assertion >::failed test2 BOOST_ATTRIBUTE_UNUSED; not_a_derived_class_member(Fn()); } }; diff --git a/include/boost/python/def.hpp b/include/boost/python/def.hpp index 76829b08..fe2c65f9 100644 --- a/include/boost/python/def.hpp +++ b/include/boost/python/def.hpp @@ -37,7 +37,7 @@ namespace detail // Must not try to use default implementations except with method definitions. typedef typename error::multiple_functions_passed_to_def< Helper::has_default_implementation - >::type assertion; + >::type assertion BOOST_ATTRIBUTE_UNUSED; detail::scope_setattr_doc( name, boost::python::make_function( diff --git a/include/boost/python/detail/config.hpp b/include/boost/python/detail/config.hpp index 1857d39a..11c16308 100644 --- a/include/boost/python/detail/config.hpp +++ b/include/boost/python/detail/config.hpp @@ -135,4 +135,8 @@ #define BOOST_PYTHON_SUPPORTS_PY_SIGNATURES // enables smooth transition #endif +#if !defined(BOOST_ATTRIBUTE_UNUSED) && defined(__GNUC__) && (__GNUC__ >= 4) +# define BOOST_ATTRIBUTE_UNUSED __attribute__((unused)) +#endif + #endif // CONFIG_DWA052200_H_ diff --git a/include/boost/python/detail/defaults_gen.hpp b/include/boost/python/detail/defaults_gen.hpp index 0b3e0e26..88beeedb 100644 --- a/include/boost/python/detail/defaults_gen.hpp +++ b/include/boost/python/detail/defaults_gen.hpp @@ -213,7 +213,7 @@ namespace detail { \ typedef typename ::boost::python::detail:: \ error::more_keywords_than_function_arguments< \ - N,n_args>::too_many_keywords assertion; \ + N,n_args>::too_many_keywords assertion BOOST_ATTRIBUTE_UNUSED; \ } \ template \ fstubs_name(::boost::python::detail::keywords const& keywords, char const* doc = 0) \ @@ -222,7 +222,7 @@ namespace detail { \ typedef typename ::boost::python::detail:: \ error::more_keywords_than_function_arguments< \ - N,n_args>::too_many_keywords assertion; \ + N,n_args>::too_many_keywords assertion BOOST_ATTRIBUTE_UNUSED; \ } # if defined(BOOST_NO_VOID_RETURNS) diff --git a/include/boost/python/init.hpp b/include/boost/python/init.hpp index b82ab01e..792de58e 100644 --- a/include/boost/python/init.hpp +++ b/include/boost/python/init.hpp @@ -68,7 +68,7 @@ namespace detail template struct more_keywords_than_init_arguments { - typedef char too_many_keywords[init_args - keywords >= 0 ? 1 : -1]; + typedef char too_many_keywords[init_args - keywords >= 0 ? 1 : -1] BOOST_ATTRIBUTE_UNUSED; }; } @@ -224,7 +224,7 @@ class init : public init_base > { typedef typename detail::error::more_keywords_than_init_arguments< N, n_arguments::value + 1 - >::too_many_keywords assertion; + >::too_many_keywords assertion BOOST_ATTRIBUTE_UNUSED; } template @@ -233,7 +233,7 @@ class init : public init_base > { typedef typename detail::error::more_keywords_than_init_arguments< N, n_arguments::value + 1 - >::too_many_keywords assertion; + >::too_many_keywords assertion BOOST_ATTRIBUTE_UNUSED; } template diff --git a/include/boost/python/make_constructor.hpp b/include/boost/python/make_constructor.hpp index 47cdf469..093703bb 100644 --- a/include/boost/python/make_constructor.hpp +++ b/include/boost/python/make_constructor.hpp @@ -174,7 +174,7 @@ namespace detail typedef typename detail::error::more_keywords_than_function_arguments< NumKeywords::value, arity - >::too_many_keywords assertion; + >::too_many_keywords assertion BOOST_ATTRIBUTE_UNUSED; typedef typename outer_constructor_signature::type outer_signature; diff --git a/test/destroy_test.cpp b/test/destroy_test.cpp index cae95ae9..57501604 100644 --- a/test/destroy_test.cpp +++ b/test/destroy_test.cpp @@ -38,7 +38,6 @@ void assert_destructions(int n) int main() { assert_destructions(0); - typedef int a[2]; foo* f1 = new foo; boost::python::detail::destroy_referent(f1);