[C++-sig] Useless use of type attributes

David Abrahams dave at boost-consulting.com
Thu Dec 8 06:37:16 CET 2005


Philipp Thomas <pth at suse.de> writes:

> boost/python/detail/wrapper_base.hpp and boost/python/detail/exception_handler.hpp
> needlessly uses type attributes in the forward declaration, which
> prompts gcc 4.1 to warn with
>
>  warning: type attributes are honored only at type definition
>
> here's a patch to fix this:

This is another GCC-specific patch.  Those macros aren't type
attributes, except on GCC, and only when targeting certain platforms.
They expand to different things on different compilers.  Are you sure
that no supported platforms need them?  I seem to recall that older
versions of MinGW, in fact, had very odd requirements in terms of
where those __declspecs were placed.

> --- boost/python/detail/exception_handler.hpp
> +++ boost/python/detail/exception_handler.hpp
> @@ -11,7 +11,7 @@
>  
>  namespace boost { namespace python { namespace detail {
>  
> -struct BOOST_PYTHON_DECL exception_handler;
> +struct exception_handler;
>  
>  typedef function2<bool, exception_handler const&, function0<void> const&> handler_function;
>  
> --- boost/python/detail/wrapper_base.hpp
> +++ boost/python/detail/wrapper_base.hpp
> @@ -14,7 +14,7 @@
>  
>  namespace detail
>  {
> -  class BOOST_PYTHON_DECL wrapper_base;
> +  class wrapper_base;
>    
>    namespace wrapper_base_ // ADL disabler
>    {

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com




More information about the Cplusplus-sig mailing list