From: SourceForge.net <no...@so...> - 2007-02-16 15:38:42
|
Bugs item #1431546, was opened at 2006-02-14 15:55 Message generated for change (Comment added) made by bramz You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=498859&aid=1431546&group_id=61929 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Configury/Installation Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Moein Alinaghian (masoft) Assigned to: Nobody/Anonymous (nobody) Summary: Error in compiling for AMD64 Initial Comment: I tried to compile Spades 1.10 on one AMD64 computer, with Ubuntu 5.10 (AMD64 Version) with GCC 4, and got these errors: testforker.cpp: In function void* pthread_func (void*) : testforker.cpp:122: error: cast from void* to int loses precision make[2]: *** [testforker.o] Error 1 make[2]: Leaving directory `/usr/src/spades- 1.10/agent_intercept' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/src/spades-1.10' make: *** [all] Error 2 Also needed to say it will compile correctly with Ubuntu 5.10 (i386 Version). ---------------------------------------------------------------------- Comment By: Bram de Greve (bramz) Date: 2007-02-16 16:38 Message: Logged In: YES user_id=792910 Originator: NO I've encountered this problem as well. The problem is of course that on AMD64, an int is 32 bits and void* 64 bits wide. I've solved the issue by removing the reinterpret_cast because it's perfectly valid to stream an address to std::cout (there's an overload that takes a void pointer). It will print the value of the pointer in hexadecimal format. If you want to (reinterpret) cast a pointer to an integer value, you should use the intptr_t and uintptr_t typedefs from inttypes.h Bramz ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=498859&aid=1431546&group_id=61929 |