[CRIU] [PATCH 7/7] parasite: fix format string typo

Andrew Vagin avagin at virtuozzo.com
Fri Feb 19 14:27:11 PST 2016


Hi Tycho,

  GEN      pie/pie.lds.S
  CC       arch/arm/restorer.o
In file included from /criu/criu/include/log.h:6:0,
                 from /criu/criu/include/bug.h:8,
                 from /criu/criu/include/image.h:12,
                 from /criu/criu/include/parasite.h:16,
                 from pie/parasite.c:11:
pie/parasite.c: In function '__parasite_daemon_reply_ack':
/criu/criu/include/criu-log.h:63:10: error: format '%lu' expects argument of type 'long unsigned int', but argument 6 has type 'unsigned int' [-Werror=format=]
          "Error (%s:%d): " LOG_PREFIX fmt,  \
          ^
pie/parasite.c:514:3: note: in expansion of macro 'pr_err'
   pr_err("Sent only %d bytes while %lu expected\n", ret, sizeof(m));
   ^
  CC       pie/restorer.o
cc1: all warnings being treated as errors

On Thu, Feb 18, 2016 at 09:08:56AM -0700, Tycho Andersen wrote:
> The pie sprintf implementation doesn't know about `z', so let's just use
> %lu instead.
> 
> Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
> ---
>  criu/pie/parasite.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/criu/pie/parasite.c b/criu/pie/parasite.c
> index 53ef609..b5cf6c9 100644
> --- a/criu/pie/parasite.c
> +++ b/criu/pie/parasite.c
> @@ -571,7 +571,7 @@ static int __parasite_daemon_reply_ack(unsigned int cmd, int err)
>  	m = ctl_msg_ack(cmd, err);
>  	ret = sys_sendto(tsock, &m, sizeof(m), 0, NULL, 0);
>  	if (ret != sizeof(m)) {
> -		pr_err("Sent only %d bytes while %zd expected\n", ret, sizeof(m));
> +		pr_err("Sent only %d bytes while %lu expected\n", ret, sizeof(m));
>  		return -1;
>  	}
>  
> -- 
> 2.6.4
> 
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu


More information about the CRIU mailing list