Nonportable code in C++ support

David Nolden zwabel at
Tue Feb 12 23:36:48 UTC 2008

On Wednesday 13 February 2008 00:21:26 Andreas Pakulat wrote:
> Hi,
> apparently there's some non-portable code in C++ support and with
> non-portable I mean building breaks on anything but 32 bit platforms.
> The problem is hashFromFunction in typerepository.cpp, line 665 and
> following. There a pointer is casted to int, which obviously won't work
> on 64 bit where this is a long.
> The error that was reported is that the cast to int looses precision,
> however I don't see a way to preserve the precision as we need to get an
> int out of the function. Ideas?
> Oh and apparently s/int/long in 265, 266 and 267 fixes the build issue.
> Andreas

Hi! The code compiles just fine on my 64 bit machine(there was an issue some 
time, but that was fixed). Where does the build fail?

Since the int does not need to 100% represent the pointer, but rather is just 
used as an approximate hash-value, the conversion should not be problematic.

greetings, David

More information about the KDevelop-devel mailing list