Menu

#2 cast from '_opaque_pthread_t*' to 'int' loses precision

open
nobody
None
5
2012-12-06
2010-09-04
No

Hi, I'm a maintainer of the MacPorts project and I'm trying to update our fastdb port from version 3.05, which doesn't compile for us anymore, to version 3.64, which doesn't either. 3.64 has the following error when compiling on Snow Leopard, which compiles 64-bit by default:

/usr/bin/g++-4.2 -c -Iinc -Wall -O0 -g -fPIC -pthread src/class.cpp
In file included from inc/sync.h:17,
from inc/class.h:15,
from inc/database.h:14,
from inc/fastdb.h:19,
from src/class.cpp:13:
inc/sync_unix.h: In static member function 'static int dbThread::getCurrentThreadId()':
inc/sync_unix.h:163: error: cast from '_opaque_pthread_t*' to 'int' loses precision

As far as I can tell, the pthread_t type that pthread_self returns is a 64-bit quantity when compiling on 64-bit Mac OS X, which is why your cast to int fails.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.