From 3c01d1b6d7373ade9ea65449c920ce175d8703cd Mon Sep 17 00:00:00 2001 From: "Peter W. Draper" <p.w.draper@durham.ac.uk> Date: Tue, 24 Nov 2020 12:09:27 +0000 Subject: [PATCH] Squash snprintf compilation warnings (gcc 7.5) --- examples/main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/main.c b/examples/main.c index 0510211985..1d6b625884 100644 --- a/examples/main.c +++ b/examples/main.c @@ -1550,8 +1550,8 @@ int main(int argc, char *argv[]) { /* Dump MPI requests if collected. */ #if defined(SWIFT_MPIUSE_REPORTS) && defined(WITH_MPI) { - char dumpfile[40]; - snprintf(dumpfile, 40, "mpiuse_report-rank%d-step%d.dat", engine_rank, + char dumpfile[80]; + snprintf(dumpfile, 80, "mpiuse_report-rank%d-step%d.dat", engine_rank, j + 1); mpiuse_log_dump(dumpfile, e.tic_step); } @@ -1560,12 +1560,12 @@ int main(int argc, char *argv[]) { #ifdef SWIFT_DEBUG_THREADPOOL /* Dump the task data using the given frequency. */ if (dump_threadpool && (dump_threadpool == 1 || j % dump_threadpool == 1)) { - char dumpfile[40]; + char dumpfile[80]; #ifdef WITH_MPI - snprintf(dumpfile, 40, "threadpool_info-rank%d-step%d.dat", engine_rank, + snprintf(dumpfile, 80, "threadpool_info-rank%d-step%d.dat", engine_rank, j + 1); #else - snprintf(dumpfile, 40, "threadpool_info-step%d.dat", j + 1); + snprintf(dumpfile, 80, "threadpool_info-step%d.dat", j + 1); #endif // WITH_MPI threadpool_dump_log(&e.threadpool, dumpfile, 1); } else { -- GitLab