[C++-sig] Bug: Pyste and pure virtual functions.

Prabhu Ramachandran prabhu at aero.iitm.ernet.in
Sat Aug 16 11:03:01 CEST 2003


>>>>> "PR" == Prabhu Ramachandran <prabhu at aero.iitm.ernet.in> writes:

>>>>> "N" == nicodemus  <nicodemus at globalite.com.br> writes:
[snip]
    N> My first version was like yours, but the missing return
    N> generates warnings with Intel 6, so I added it. I didn't know
    N> it would generate an error in gcc, thought 8/ Any suggestions?

    PR> Well, it will generate errors under Intel 6 also if the
    PR> returned class has no nullary constructor.  I'm not sure if
    PR> 'return unsigned int();' will also compile correctly.

    PR> One alternative is that for standard types (int, float etc.)
    PR> the brackets are removed but the return value is there.  For
    PR> classes/structures that are returned we add the brackets or
    PR> alternatively dont return anything and live with the warnings.
    PR> It would be nice if there were a better way.

I just found an obvious way to get around this -- simply call the
wrapped function (afterall this is only to satisfy the compiler).
Attached is a patch to fix the problem with Pyste from CVS.  This
works fine for me.

BTW, Boost.Python from current (anonymous access) CVS does not build
cleanly and produces lots of errors that look like this:

/cvs/boost/boost/python/object_core.hpp: In instantiation of `boost::python::api::is_derived_impl<const boost::python::scope &,boost::python::api::object>':
/cvs/boost/boost/python/object_core.hpp:258:   instantiated from `boost::python::api::is_derived<const boost::python::scope &,boost::python::api::object>'
/cvs/boost/boost/python/object_core.hpp:258:   instantiated from `boost::python::api::object_base_initializer<boost::python::scope>(const boost::python::scope &)'
/cvs/boost/boost/python/object_core.hpp:270:   instantiated from here
/cvs/boost/boost/python/object_core.hpp:231: invalid use of undefined type `struct boost::python::api::is_derived_impl<const boost::python::scope &,boost::python::api::object>'
/cvs/boost/boost/python/object_core.hpp:232: forward declaration of `struct boost::python::api::is_derived_impl<const boost::python::scope &,boost::python::api::object>'
/cvs/boost/boost/python/object_core.hpp:231: invalid use of undefined type `struct boost::python::api::is_derived_impl<const boost::python::scope &,boost::python::api::object>'
/cvs/boost/boost/python/object_core.hpp:232: forward declaration of `struct boost::python::api::is_derived_impl<const boost::python::scope &,boost::python::api::object>'
[snip similar errors]

I checked out a copy as of "2003-08-14" and things build cleanly.


cheers,
prabhu

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Pyste-bugfix.patch
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20030816/02969559/attachment.txt>


More information about the Cplusplus-sig mailing list