From e69e570d15b41c20f53ea6861c06fa9f8f628063 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Sat, 13 Oct 2018 15:34:44 +0200 Subject: [PATCH] Fix format string. --- src/smpi/internals/smpi_global.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/smpi/internals/smpi_global.cpp b/src/smpi/internals/smpi_global.cpp index 65bfc09ca4..21e938e25f 100644 --- a/src/smpi/internals/smpi_global.cpp +++ b/src/smpi/internals/smpi_global.cpp @@ -15,6 +15,7 @@ #include #include /* DBL_MAX */ +#include /* intmax_t */ #include #include #include @@ -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()); - XBT_DEBUG("Copy %ld bytes into %s", static_cast(fdin_size), target.c_str()); + XBT_DEBUG("Copy %jd bytes into %s", static_cast(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 %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(fdin_size), errno, strerror(errno)); #else const int bufsize = 1024 * 1024 * 4; char buf[bufsize]; -- 2.20.1