[Mpi-forum] Compile problems with examples in MPI Standard

Dries Kimpe dkimpe at mcs.anl.gov
Tue Jul 24 10:39:46 CDT 2012


* William Gropp <wgropp at illinois.edu> [2012-07-24 10:27:43]:

> Here's the test case for everyone.  No const.

> int MPI_Init( int *argc_p, char *((*argv_p)[]) );
> int main( int argc, char *argv[] )
> { 
>      MPI_Init( &argc, &argv );
>      return 0;
> }  

> This gives a warning with my gcc:

> GroppsMac3:MPI-3.0 gropp$ gcc -c f1.c
> f1.c: In function ‘main’:
> f1.c:4: warning: passing argument 2 of ‘MPI_Init’ from incompatible pointer type

gcc 4.5.3 gives the reason for the warning in more detail:

t.c: In function ‘main’:
t.c:5:6: warning: passing argument 2 of ‘MPI_Init’ from incompatible pointer type
t.c:2:5: note: expected ‘char * (*)[]’ but argument is of type ‘char ***’

   Dries
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.mpi-forum.org/pipermail/mpi-forum/attachments/20120724/2cbd47f3/attachment-0001.pgp>


More information about the mpi-forum mailing list