Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use PRIdMAX instead of %jd.
[simgrid.git] / src / smpi / internals / smpi_global.cpp
index 21e938e..f63b4d9 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <algorithm>
 #include <cfloat> /* DBL_MAX */
+#include <cinttypes>
 #include <cstdint> /* intmax_t */
 #include <dlfcn.h>
 #include <fcntl.h>
@@ -490,11 +491,12 @@ static void smpi_copy_file(std::string src, std::string target, off_t fdin_size)
   int fdout = open(target.c_str(), O_CREAT | O_RDWR, S_IRWXU);
   xbt_assert(fdout >= 0, "Cannot write into %s", target.c_str());
 
-  XBT_DEBUG("Copy %jd bytes into %s", static_cast<intmax_t>(fdin_size), target.c_str());
+  XBT_DEBUG("Copy %" PRIdMAX " bytes into %s", static_cast<intmax_t>(fdin_size), target.c_str());
 #if HAVE_SENDFILE
   ssize_t sent_size = sendfile(fdout, fdin, NULL, fdin_size);
-  xbt_assert(sent_size == fdin_size, "Error while copying %s: only %zd bytes copied instead of %jd (errno: %d -- %s)",
-             target.c_str(), sent_size, static_cast<intmax_t>(fdin_size), errno, strerror(errno));
+  xbt_assert(sent_size == fdin_size,
+             "Error while copying %s: only %zd bytes copied instead of %" PRIdMAX " (errno: %d -- %s)", target.c_str(),
+             sent_size, static_cast<intmax_t>(fdin_size), errno, strerror(errno));
 #else
   const int bufsize = 1024 * 1024 * 4;
   char buf[bufsize];