Archived

This forum has been archived. Please start a new discussion on GitHub.

PyIce on FreeBSD/amd64

Hello,

I've created a port of PyIce for FreeBSD. It compiles just fine on i386 platform. But on amd64 it gives an error. Here are the details.

$ uname -srm
FreeBSD 6.0-BETA4 amd64

$ gcc -v
Using built-in specs.
Configured with: FreeBSD/amd64 system compiler
Thread model: posix
gcc version 3.4.4 [FreeBSD] 20050518
gmake[2]: Entering directory `/usr/ports/devel/py-ice/work/IcePy-2.1.2/modules/IcePy'
c++ -c -I. -I/usr/local/include -I/usr/local/include/python2.4 -g -ftemplate-depth-128 -fPIC -Wall -D_REENTRANT -D_THREAD_SAFE Operation.cpp
Operation.cpp: In member function `virtual void IcePy::ParamInfo::unmarshaled(PyObject*, PyObject*, void*)':
Operation.cpp:330: error: reinterpret_cast from `void*' to `int' loses precision
Operation.cpp: In member function `virtual void IcePy::OperationI::dispatch(PyObject*, const Ice::AMD_Object_ice_invokePtr&, const std::vector<Ice::Byte, std::allocator<Ice::Byte> >&, const Ice::Current&)':
Operation.cpp:644: warning: cast to pointer from integer of different size
Operation.cpp: In member function `PyObject* IcePy::OperationI::unmarshalResults(const std::vector<Ice::Byte, std::allocator<Ice::Byte> >&, const Ice::CommunicatorPtr&)':
Operation.cpp:1038: warning: cast to pointer from integer of different size
gmake[2]: *** [Operation.o] Error 1
gmake[2]: Leaving directory `/usr/ports/devel/py-ice/work/IcePy-2.1.2/modules/IcePy'
gmake[1]: *** [all] Error 1
gmake[1]: Leaving directory `/usr/ports/devel/py-ice/work/IcePy-2.1.2/modules'
gmake: *** [all] Error 1
*** Error code 2

Thank you.

Comments

  • mes
    mes California
    Hi Boris,

    Thanks for the bug report. There are three files which have this problem: Current.cpp, Operation.cpp and Types.cpp. To correct the compiler error, you need to change the cast from int to long. For example, in the case of Operation.cpp, change line 330 from

    int i = reinterpret_cast<int>(closure);

    to

    long i = reinterpret_cast<long>(closure);

    Similar changes are necessary in the other two files.

    We'll fix these errors in the next release.

    Take care,
    - Mark