#4 kgb_arch_posix: cast from 'char*' to 'int' loses precision

open
nobody
None
5
2007-07-09
2007-07-09
Raphael Geissert
No

Hello,

kgb_arch_posix fails to build under amd64, alpha and ia64 because of the mentioned error. Here' the build log:

g++ kgb_arch_posix_by_slawek.cpp -o kgb
kgb_arch_posix_by_slawek.cpp: In constructor 'Hashtable<T>::Hashtable(U32) [with T = Counter]':
kgb_arch_posix_by_slawek.cpp:1360: instantiated from here
kgb_arch_posix_by_slawek.cpp:1125: error: cast from 'char*' to 'int' loses precision

The error is the same one under the three different architectures.

Discussion

  • Logged In: NO

    Adding the -m32 flag works.

    g++ -m32 -O3 -o kgb_arch kgb_arch_posix.cpp

    You get a 32 bit executable, but it works once copied into /usr/local/bin, assuming you did not set your system to disallow 32 bit binaries.