Hi,
I am using:
FreeBSD-CURRENT
gcc version 3.2.2 [FreeBSD] 20030205 (release)
On FreeBSD, pthread_t is a typedef for "struct pthread *"
When compiling IceSSL, I get this error:
OpenSSLPluginI.cpp: In function `long unsigned int idFunction()':
OpenSSLPluginI.cpp:151: invalid static_cast from type `pthread*' to type `long
unsigned int'
Why is a static_cast necessary for this code? If I change to a C-style cast,
the problem goes away:
--- OpenSSLPluginI.cpp.orig Wed May 28 17:58:00 2003
+++ OpenSSLPluginI.cpp Thu May 29 22:34:13 2003
@@ -148,7 +152,7 @@
#ifdef _WIN32
return static_cast<unsigned long>(GetCurrentThreadId());
#else
- return static_cast<unsigned long>(pthread_self());
+ return (unsigned long)pthread_self();
#endif
}
}

Reply With Quote