Subj : Re: How to pass class-member function to pthread_create(....)? To : comp.programming.threads From : David Hopwood Date : Mon Jul 18 2005 09:19 pm David Schwartz wrote: > "Vyacheslav Kononenko" wrote: > >>Hmm if its unsafe to use a different linkage function by a pointer, why >>C++ compiler does not warn at least? In ideal it should fail to compile >>when I try to assign incompatible pointers, shall it not?. > > It's inconvenient to generate a warning (it is just not easy to do). It would be trivial to generate a warning (the function passed to pthread_create has the wrong type, and compilers usually diagnose type errors similar to this when the relevant prototype is in scope). Note however that the original program snippets did not #include , which might account for the lack of a warning from some compilers in this case. Anyway, it's obvious that absence of a warning doesn't imply that the code will work. -- David Hopwood .