]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix printf warning in libmpiwrap.c
authorMark Wielaard <mark@klomp.org>
Sun, 10 Oct 2021 14:35:37 +0000 (16:35 +0200)
committerMark Wielaard <mark@klomp.org>
Sun, 10 Oct 2021 14:38:24 +0000 (16:38 +0200)
libmpiwrap.c:1379:45: warning: format '%d' expects argument of type 'int',
but argument 5 has type 'MPI_Request' {aka 'struct ompi_request_t *'}

Unfortunately MPI_Request is an opaque type (we don't really know what
is in struct ompi_request_t) so we cannot simply print it as int. In
other places we print an MPI_Request as 0x%lx by casting it to an
unsigned long. Do the same here.

mpi/libmpiwrap.c

index 1ec0c202aedab68709cfd332a5c548107a0e9717..b277617854006ae094ec6f46d1d0eebd4249ab32 100644 (file)
@@ -1376,8 +1376,8 @@ static void maybe_complete ( Bool         error_in_status,
       if (count_from_Status(&recv_count, shadow->datatype, status)) {
          make_mem_defined_if_addressable(shadow->buf, recv_count, shadow->datatype);
          if (opt_verbosity > 1)
-            fprintf(stderr, "%s %5d: sReq- %d (completed)\n",
-                            preamble, my_pid, request_before);
+            fprintf(stderr, "%s %5d: sReq- 0x%lx (completed)\n",
+                            preamble, my_pid, (unsigned long) request_before);
       }
       delete_shadow_Request(request_before);
    }