title: pthread_create does not work due to void pointer and integer conversion error
body: <p>How/why do you convert to/from a void pointer or int?  </p>
  
  <p>The following code wrongly generates compiler errors:</p>
  
  <pre><code>while(num_producers &gt; 0) {
      pthread_t tid; // id of pthread (not used except to call pthread_create)
      pthread_attr_t attr; // pthread attributes (not used except to call pthread_create)
      pthread_attr_init(&amp;attr); // default pthread attributes
      pthread_create(&amp;tid, &amp;attr, producer, num_producers);
      num_producers--;
  }
  </code></pre>
  
  <p>The following errors appear (all on the pthread_create line):</p>
  
  <pre class="lang-none prettyprint-override"><code>error: invalid conversion from 'void (*)(int)' to 'void* (*)(void*)'
    error: initializing argument 3 of 'int pthread_create(_opaque_pthread)t**, const pthread_attr_t*, void* (*)(void*), void*)'
    error: invalid conversion from 'int' to 'void*'
    error: initializing argument 4 of 'int pthread_create(_opaque_pthread_t**, const pthread_attr_t*, void* (*)(void*), void*)'
  </code></pre>
  
  <p>I want to create a pthread that runs (only) the function "producer" also contained in the same file as main.  Why doesn't this work?</p>