Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix error: passing argument 7 of ‘SIMIX_req_comm_isend’ from incompatible pointer...
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Mon, 9 Jan 2012 13:48:25 +0000 (14:48 +0100)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Tue, 10 Jan 2012 12:24:15 +0000 (13:24 +0100)
Note: casting non-compatible pointers to functions results in undefined behavior.

src/smpi/smpi_base.c

index 1751f25..39859d8 100644 (file)
@@ -63,6 +63,11 @@ static MPI_Request build_request(void *buf, int count,
   return request;
 }
 
   return request;
 }
 
+static void smpi_mpi_request_free_voidp(void* request)
+{
+  smpi_mpi_request_free(request);
+}
+
 /* MPI Low level calls */
 MPI_Request smpi_mpi_send_init(void *buf, int count, MPI_Datatype datatype,
                                int dst, int tag, MPI_Comm comm)
 /* MPI Low level calls */
 MPI_Request smpi_mpi_send_init(void *buf, int count, MPI_Datatype datatype,
                                int dst, int tag, MPI_Comm comm)
@@ -115,7 +120,7 @@ void smpi_mpi_start(MPI_Request request)
                SIMIX_req_comm_isend(mailbox, request->size, -1.0,
                                    request->buf, request->size,
                                    &match_send,
                SIMIX_req_comm_isend(mailbox, request->size, -1.0,
                                    request->buf, request->size,
                                    &match_send,
-                                   (void (*)(void *))&smpi_mpi_request_free, // how to free the userdata if a detached send fails
+                                   &smpi_mpi_request_free_voidp, // how to free the userdata if a detached send fails
                                    request,
                                    // detach if msg size < eager/rdv switch limit
                                    detached);
                                    request,
                                    // detach if msg size < eager/rdv switch limit
                                    detached);