[ovs-dev] [PATCH] perf-counter: Fix 32-bit build break due to incorrect printf specifiers.

Ben Pfaff blp at nicira.com
Tue Apr 14 20:47:27 UTC 2015


Fixes the following warnings from GCC on 32-bit architectures:

    ../lib/perf-counter.c: In function 'perf_counter_to_ds':
    ../lib/perf-counter.c:119:19: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'uint64_t' [-Werror=format]
    ../lib/perf-counter.c:119:19: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'uint64_t' [-Werror=format]

Signed-off-by: Ben Pfaff <blp at nicira.com>
---
 lib/perf-counter.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/perf-counter.c b/lib/perf-counter.c
index e72ff29..7bd7834 100644
--- a/lib/perf-counter.c
+++ b/lib/perf-counter.c
@@ -115,8 +115,8 @@ perf_counter_to_ds(struct ds *ds, struct perf_counter *pfc)
         ratio = 0.0;
     }
 
-    ds_put_format(ds, "%-40s%12lu%12lu%12.1f\n", pfc->name, pfc->n_events,
-                  pfc->total_count, ratio);
+    ds_put_format(ds, "%-40s%12"PRIu64"%12"PRIu64"%12.1f\n",
+                  pfc->name, pfc->n_events, pfc->total_count, ratio);
 }
 
 static void
-- 
1.7.10.4




More information about the dev mailing list