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

Andy Zhou azhou at nicira.com
Tue Apr 14 20:50:23 UTC 2015


Looks good, thanks for fixing them.

Acked-by: Andy Zhou <azhou at nicira.com>

On Tue, Apr 14, 2015 at 1:47 PM, Ben Pfaff <blp at nicira.com> wrote:
> 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
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev



More information about the dev mailing list