Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix format string.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sat, 13 Oct 2018 13:34:44 +0000 (15:34 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Sat, 13 Oct 2018 14:04:20 +0000 (16:04 +0200)
src/smpi/internals/smpi_global.cpp

index 65bfc09..21e938e 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <algorithm>
 #include <cfloat> /* DBL_MAX */
 
 #include <algorithm>
 #include <cfloat> /* DBL_MAX */
+#include <cstdint> /* intmax_t */
 #include <dlfcn.h>
 #include <fcntl.h>
 #include <fstream>
 #include <dlfcn.h>
 #include <fcntl.h>
 #include <fstream>
@@ -489,11 +490,11 @@ 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());
 
   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 %ld bytes into %s", static_cast<long>(fdin_size), target.c_str());
+  XBT_DEBUG("Copy %jd 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);
 #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 %ld (errno: %d -- %s)",
-             target.c_str(), sent_size, fdin_size, errno, strerror(errno));
+  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));
 #else
   const int bufsize = 1024 * 1024 * 4;
   char buf[bufsize];
 #else
   const int bufsize = 1024 * 1024 * 4;
   char buf[bufsize];