title: warning: passing argument 7 of ‘MPI_Recv’ from incompatible pointer type
body: <p>I'm trying to compile an MPI_Exchange function but keep getting the below errors.</p>
  
  <p>Error:</p>
  
  <pre><code>OddEvenSort.c: In function ‘MPI_Exchange’:
  OddEvenSort.c:75: warning: passing argument 7 of ‘MPI_Recv’ from incompatible pointer type
  /usr/lib/openmpi/include/mpi.h:1174: note: expected ‘struct MPI_Status *’ but argument is of type ‘int *’
  OddEvenSort.c:84: warning: passing argument 7 of ‘MPI_Recv’ from incompatible pointer type
  /usr/lib/openmpi/include/mpi.h:1174: note: expected ‘struct MPI_Status *’ but argument is of type ‘int *’
  /usr/bin/mpicc  -o OddEvenSort OddEvenSort.o -lm
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>int MPI_Exchange( int n, double *a, int rank1, int rank2,MPI_Comm comm )
  {
     int rank, tag1, tag2, size, i, status;
     double * b, * c;
  
  
    MPI_Comm_rank(comm, &amp;rank);
    MPI_Comm_size(comm, &amp;size);
  
     if(rank == rank1){
       MPI_Send(&amp;a[0],n,MPI_DOUBLE,rank2,tag1,comm);
       MPI_Recv(&amp;b[0],n,MPI_DOUBLE,rank2,tag2,comm,&amp;status);
       c = merge_array(n,a,n,b);
       for(i=0;i&lt;n;i++){
         a[i] = c[i];
       }
  
     }
     else if(rank == rank2){
        MPI_Send(&amp;a[0],n,MPI_DOUBLE,rank1,tag1,comm);
       MPI_Recv(&amp;b[0],n,MPI_DOUBLE,rank1,tag2,comm,&amp;status);
       c = merge_array(n,a,n,b);
       for(i=0;i&lt;n;i++){
         a[i] = c[i+n];
       }
     }
  
       return MPI_SUCCESS;
      }
  </code></pre>
  
  <p>I believe the errors refer to <code>&amp;status</code> in the two instances of <code>MPI_Recv</code>. I'm trying to get the address of status, which was declared earlier on in my code as <code>MPI_Status status</code>.</p>