Warn for type mismatch for gmx printf like functions 3/3
[alexxy/gromacs.git] / src / gromacs / awh / bias.cpp
index bde1a68fbeac4416386f3092cc8e74157c42763d..437784e24d3c4c760af9f068ffec1cbf4c7face9 100644 (file)
@@ -47,6 +47,7 @@
 #include "bias.h"
 
 #include <cassert>
+#include <cinttypes>
 #include <cmath>
 #include <cstdio>
 #include <cstdlib>
@@ -242,7 +243,7 @@ static void ensureStateAndRunConsistency(const BiasParams &params,
     int64_t numUpdatesExpected    = state.histogramSize().numUpdates();
     if (numUpdatesFromSamples != numUpdatesExpected)
     {
-        std::string mesg = gmx::formatString("The number of AWH updates in the checkpoint file (%ld) does not match the total number of AWH samples divided by the number of samples per update for %d sharing AWH bias(es) (%ld/%d=%ld)",
+        std::string mesg = gmx::formatString("The number of AWH updates in the checkpoint file (%" PRId64 ") does not match the total number of AWH samples divided by the number of samples per update for %d sharing AWH bias(es) (%" PRId64 "/%d=%" PRId64 ")",
                                              numUpdatesExpected,
                                              params.numSharedUpdate,
                                              numSamples,
@@ -255,7 +256,7 @@ static void ensureStateAndRunConsistency(const BiasParams &params,
          */
         if (numUpdatesFromSamples % state.histogramSize().numUpdates() == 0)
         {
-            mesg += gmx::formatString(" Or the run you continued from used %ld sharing simulations, whereas you now specified %d sharing simulations.",
+            mesg += gmx::formatString(" Or the run you continued from used %" PRId64 " sharing simulations, whereas you now specified %d sharing simulations.",
                                       numUpdatesFromSamples/state.histogramSize().numUpdates(),
                                       params.numSharedUpdate);
         }