[C++-sig] Boost::Python 1.13.1 on SuSE 9.1 x86_64

Jan Heiser jan.heiser at raubtierbaendiger.de
Wed Aug 4 18:11:10 CEST 2004


Hi there,

I have successfully compiled Boost 1.31.1 on SuSE 9.1 x86_64 (with the regex
patch and the SuSE 9.x patch published in this list/newsgroup).

It worked. However, when I tried to compile some code written for
Boost::python, I ran into the following problem (compiling with -Wall
-Werror) :

/usr/local/include/boost-1_31/boost/python/with_custodian_and_ward.hpp: In
   static member function `static PyObject*
   boost::python::with_custodian_and_ward_postcall<custodian, ward,
   BasePolicy_>::postcall(const ArgumentPackage&, PyObject*) [with
   ArgumentPackage = PyObject*, long unsigned int custodian = 0, long
unsigned
   int ward = 1, BasePolicy_ = boost::python::default_call_policies]':
/usr/local/include/boost-1_31/boost/python/detail/caller.hpp:201:  
instantiated
 from `PyObject* boost::python::detail::caller_arity<1>::impl<F, Policies,
Sig>:
:operator()(PyObject*, PyObject*) [with F = XXX, Policies =
boost::python::return_internal_reference<1, boost:
:python::default_call_policies>, Sig = boost::mpl::vector2<XXX,YYY>]'
/usr/local/include/boost-1_31/boost/python/object/py_function.hpp:39:  
instanti
ated from `PyObject*
boost::python::objects::caller_py_function_impl<Caller>::op
erator()(PyObject*, PyObject*) [with Caller =
boost::python::detail::caller<XXX () const,
boost::python::return_internal_reference<1,
boost::python::default_call_policies>, boost::mpl::vector2<XXX,YYY> >]'
/usr/local/include/boost-1_31/boost/mpl/if.hpp:75:   instantiated from here
/usr/local/include/boost-1_31/boost/python/with_custodian_and_ward.hpp:89:
warning: comparison
   is always false due to limited range of data type


It boils down to the fact that on x86_64 unsigned and std::size_t do not
have the same width, unsigned still has 32 bits, std::size_t has 64 bits.


Now, my idea was to directly change the template function:

boost/python/with_custodian_and_ward.hpp:79
- template <std::size_t custodian, std::size_t ward, class BasePolicy_ =
default_call_policies>
+ template <unsigned custodian, unsigned ward, class BasePolicy_ =
default_call_policies>


Now my questions:

Has anybody else in the world dared to compile and use Boost::python on
Linux x86_64 or another 64bit OS?

Is the proposed change sensible or does it more damage than it heals?
(probably there are more places to change accordingly, though)

How to get that into CVS?

Jan





More information about the Cplusplus-sig mailing list