From 9a10d9dc4c75ef2443ecf56b1ef7cb0720d061b9 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Fri, 25 Jan 2013 14:07:18 +0100 Subject: [PATCH 1/1] Use %zu for type size_t. --- README.coding | 3 ++- src/smpi/smpi_base.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.coding b/README.coding index a2ea54f742..e48b67f5df 100644 --- a/README.coding +++ b/README.coding @@ -89,7 +89,8 @@ MALLOC: SIZE_T (FIXME: obsolete?) If possible, avoid size_t and use unsigned long instead. If not, #include in all files manipulating size_t - do cast it to unsigned long before printing (and use %lu) + do cast it to unsigned long before printing (and use %lu), + or use %zu. PRINTF pointer difference (FIXME: advertise %td instead?) printf ("diff = %ld\n", (long) (pointer2 - pointer1)); diff --git a/src/smpi/smpi_base.c b/src/smpi/smpi_base.c index 614067d45c..38a9b54eea 100644 --- a/src/smpi/smpi_base.c +++ b/src/smpi/smpi_base.c @@ -296,7 +296,7 @@ void smpi_mpi_start(MPI_Request request) double sleeptime = smpi_or(request->size); if(sleeptime!=0.0){ simcall_process_sleep(sleeptime); - XBT_DEBUG("receiving size of %ld : sleep %lf ", request->size, smpi_or(request->size)); + XBT_DEBUG("receiving size of %zu : sleep %lf ", request->size, smpi_or(request->size)); } } else { @@ -332,7 +332,7 @@ void smpi_mpi_start(MPI_Request request) double sleeptime = smpi_os(request->size); if(sleeptime!=0.0){ simcall_process_sleep(sleeptime); - XBT_DEBUG("sending size of %ld : sleep %lf ", request->size, smpi_os(request->size)); + XBT_DEBUG("sending size of %zu : sleep %lf ", request->size, smpi_os(request->size)); } request->action = simcall_comm_isend(mailbox, request->size, -1.0, -- 2.20.1