[ovs-dev] [PATCH] dpif-linux: Fix invalid format specifier.

Justin Pettit jpettit at nicira.com
Wed Jun 6 06:41:31 UTC 2012


I'm not an expert on pointer subtraction, but I think the result is actually of type ptrdiff_t and you'd print it with "%td". Also, isn't it the third argument?

--Justin


On Jun 5, 2012, at 6:08 PM, Ethan Jackson wrote:

> This fixes the following warning on my system. "format '%d' expects
> argument of type 'int', but argument 5 has type 'long int'"
> 
> Signed-off-by: Ethan Jackson <ethan at nicira.com>
> ---
> lib/dpif-linux.c |    2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/dpif-linux.c b/lib/dpif-linux.c
> index b571441..8852548 100644
> --- a/lib/dpif-linux.c
> +++ b/lib/dpif-linux.c
> @@ -1981,7 +1981,7 @@ report_loss(struct dpif *dpif_, struct dpif_channel *ch)
>     }
>     ds_chomp(&s, ',');
> 
> -    VLOG_ERR("%s: lost packet on channel %d%s",
> +    VLOG_ERR("%s: lost packet on channel %ld%s",
>              dpif_name(dpif_), ch - dpif->channels, ds_cstr(&s));
>     ds_destroy(&s);
> }
> -- 
> 1.7.10.2
> 
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev




More information about the dev mailing list