[python] type attributes in forward declarations

Class declarations like this... class BOOST_PYTHON_DECL wrapper_base; are causing compiler warnings on gcc 4.0.2 with a warning like: type attributes are honored only at type definition However, I see this is also used to handle the insane import/export windows DLL stuff. Since I do not do much compilation on the windows platforms anymore, is the BOOST_PYTHON_DECL really necessary in the forward declaration, or is it just a convention? Thanks!

On Thu, 19 Jan 2006 09:45:10 -0500 Jody Hagins <jody-boost-011304@atdesk.com> wrote:
Class declarations like this...
class BOOST_PYTHON_DECL wrapper_base;
are causing compiler warnings on gcc 4.0.2 with a warning like:
type attributes are honored only at type definition
However, I see this is also used to handle the insane import/export windows DLL stuff. Since I do not do much compilation on the windows platforms anymore, is the BOOST_PYTHON_DECL really necessary in the forward declaration, or is it just a convention?
After looking a bit more, I see a BOOST_PYTHON_DECL_FORWARD in config.hpp. Should this be used here instead?

Jody Hagins <jody-boost-011304@atdesk.com> writes:
On Thu, 19 Jan 2006 09:45:10 -0500 Jody Hagins <jody-boost-011304@atdesk.com> wrote:
Class declarations like this...
class BOOST_PYTHON_DECL wrapper_base;
are causing compiler warnings on gcc 4.0.2 with a warning like:
type attributes are honored only at type definition
However, I see this is also used to handle the insane import/export windows DLL stuff. Since I do not do much compilation on the windows platforms anymore, is the BOOST_PYTHON_DECL really necessary in the forward declaration, or is it just a convention?
After looking a bit more, I see a BOOST_PYTHON_DECL_FORWARD in config.hpp. Should this be used here instead?
Sounds right to me. Patches welcome. -- Dave Abrahams Boost Consulting www.boost-consulting.com

On Thu, 19 Jan 2006 19:49:40 -0500 David Abrahams <dave@boost-consulting.com> wrote:
Sounds right to me. Patches welcome.
We have the release version of 1.33.1 in our CVS repository. Here is the result of running "cvs -q diff -du" after making the patch changes in my local repository. Is this sufficient, or should I submit in a different manner? telaranrhiod:jody> cvs -q diff -du Index: boost/python/detail/exception_handler.hpp =================================================================== RCS file: /home/src/boost/boost/python/detail/exception_handler.hpp,v retrieving revision 1.1.1.3 diff -d -u -r1.1.1.3 exception_handler.hpp --- boost/python/detail/exception_handler.hpp 26 Nov 2004 15:45:29 -0000 1.1.1.3 +++ boost/python/detail/exception_handler.hpp 20 Jan 2006 13:18:51 -0000 @@ -11,7 +11,7 @@ namespace boost { namespace python { namespace detail { -struct BOOST_PYTHON_DECL exception_handler; +struct BOOST_PYTHON_DECL_FORWARD exception_handler; typedef function2<bool, exception_handler const&, function0<void> const&> handler_function; Index: boost/python/detail/wrapper_base.hpp =================================================================== RCS file: /home/src/boost/boost/python/detail/wrapper_base.hpp,v retrieving revision 1.1.1.1 diff -d -u -r1.1.1.1 wrapper_base.hpp --- boost/python/detail/wrapper_base.hpp 26 Nov 2004 15:45:29 -0000 1.1.1.1 +++ boost/python/detail/wrapper_base.hpp 20 Jan 2006 13:18:51 -0000 @@ -14,7 +14,7 @@ namespace detail { - class BOOST_PYTHON_DECL wrapper_base; + class BOOST_PYTHON_DECL_FORWARD wrapper_base; namespace wrapper_base_ // ADL disabler {

Jody Hagins <jody-boost-011304@atdesk.com> writes:
On Fri, 20 Jan 2006 08:26:11 -0500 Jody Hagins <jody-boost-011304@atdesk.com> wrote:
Is this sufficient, or should I submit in a different manner?
Yuk! Sorry. The mailer auto-wrapped the lines. The file is attached...
Applied; thanks! -- Dave Abrahams Boost Consulting www.boost-consulting.com

I'm not sure all the places this problem may exist, but in building boost itself, here are the unique warning locations: boost/python/detail/exception_handler.hpp:14: warning: type attributes are honored only at type definition boost/python/detail/wrapper_base.hpp:17: warning: type attributes are honored only at type definition
participants (2)
-
David Abrahams
-
Jody Hagins