title: pthread_create not working. passing argument 3 warning
body: <p>I am trying to create a thread and from what I remember this should be the right way to do it:</p>
  
  <pre><code>#include &lt;pthread.h&gt;
  #include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #define NUM_THREADS 5
  
  int SharedVariable =0;
  void SimpleThread(int which)
  {
      int num,val;
      for(num=0; num&lt;20; num++){
          if(random() &gt; RAND_MAX / 2)
              usleep(10);
          val = SharedVariable;
          printf("*** thread %d sees value %d\n", which, val);
          SharedVariable = val+1;
      }
      val=SharedVariable;
      printf("Thread %d sees final value %d\n", which, val);
  }
  
  int main (int argc, char *argv[])
  {
     pthread_t threads[NUM_THREADS];
     int rc;
     long t;
     for(t=0; t&lt; NUM_THREADS; t++){
        printf("In main: creating thread %ld\n", t);
        rc = pthread_create(&amp;threads[t], NULL, SimpleThread, (void* )t);
        if (rc){
           printf("ERROR; return code from pthread_create() is %d\n", rc);
           exit(-1);
        }
     }
  
     /* Last thing that main() should do */
     pthread_exit(NULL);
  }
  </code></pre>
  
  <p>And the error that I'm getting is this one:</p>
  
  <blockquote>
    <p>test.c: In function ‘main’: test.c:28: warning: passing argument 3 of
    ‘pthread_create’ from incompatible pointer type
    /usr/include/pthread.h:227: note: expected ‘void * (*<em>)(void *</em>)’ but
    argument is of type ‘void (*)(int)’</p>
  </blockquote>
  
  <p>I cannot change the SimpleThread function so changing the type of the parameter is not an option even though I already tried and it didn't work either.</p>
  
  <p>What am I doing wrong?</p>