Subj : Re: How to pass class-member function to pthread_create(....)? To : comp.programming.threads From : David Schwartz Date : Mon Jul 18 2005 02:01 pm "Vyacheslav Kononenko" wrote in message news:1121716209.791867.49150@g47g2000cwa.googlegroups.com... >> So what's the point of declaring a function extern "C" other then make >> it callable from C? > But make it callable from C is different than guarantee that _ANY_ C > code compiled by _ANY_ C compiler or C++ compiler in C mode with _ANY_ > set of options will call extern "C" function correctly, isn't it? Good thing nobody ever claimed anything like that. >> It might work. But why would one gamble and depend on something that >> might work if there is an easy approach that is required to work because >> there are specifications that guaranties that this approach will work? > There is no such specifications that the problem. You have to know that > your C library compiler code is compatible with C++ compiler generated > code anyway. And you can know if it is safe to call extern "C++" > linkage from the C library as well. Huh? The purpose of extern "C" is specifically does ensure that your C++ compiler generated code is compatible with C code. You can know that you have this compatability by passing '-pthread' to your C++ compiler, which is guaranteed to provide a compatible (with that compiler) pthreads implementations. To put it another way, if your compiler supports pthreads, extern "C" *must* work. If your compiler does not, nothing will work. DS .