The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc/pull/1093

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Fixes build failures on arm:

criu.c: In function ‘exec_criu’:
criu.c:310:4: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint64_t’ [-Werror=format=]
    ret = sprintf(ghost_limit, "%lu", opts->user->ghost_limit);
    ^
In file included from criu.c:42:0:
log.h:285:9: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint64_t’ [-Werror=format=]
  struct lxc_log_locinfo locinfo = LXC_LOG_LOCINFO_INIT;  \
         ^
criu.c:312:5: note: in expansion of macro ‘ERROR’
     ERROR("failed to print ghost limit %lu", opts->user->ghost_limit);
     ^

Signed-off-by: Christian Brauner <cbrau...@suse.de>
From 9b945f132023a099733f9cc51982677c8de7ecdc Mon Sep 17 00:00:00 2001
From: Christian Brauner <cbrau...@suse.de>
Date: Fri, 22 Jul 2016 11:14:24 +0200
Subject: [PATCH] c/r: use PRIu64 format specifier
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fixes build failures on arm:

criu.c: In function ‘exec_criu’:
criu.c:310:4: error: format ‘%lu’ expects argument of type ‘long unsigned int’, 
but argument 3 has type ‘uint64_t’ [-Werror=format=]
    ret = sprintf(ghost_limit, "%lu", opts->user->ghost_limit);
    ^
In file included from criu.c:42:0:
log.h:285:9: error: format ‘%lu’ expects argument of type ‘long unsigned int’, 
but argument 3 has type ‘uint64_t’ [-Werror=format=]
  struct lxc_log_locinfo locinfo = LXC_LOG_LOCINFO_INIT;  \
         ^
criu.c:312:5: note: in expansion of macro ‘ERROR’
     ERROR("failed to print ghost limit %lu", opts->user->ghost_limit);
     ^

Signed-off-by: Christian Brauner <cbrau...@suse.de>
---
 src/lxc/criu.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/lxc/criu.c b/src/lxc/criu.c
index d330d72..69d25cf 100644
--- a/src/lxc/criu.c
+++ b/src/lxc/criu.c
@@ -22,6 +22,7 @@
  */
 #define _GNU_SOURCE
 #include <assert.h>
+#include <inttypes.h>
 #include <linux/limits.h>
 #include <sched.h>
 #include <stdio.h>
@@ -307,9 +308,9 @@ static void exec_criu(struct criu_opts *opts)
                if (opts->user->ghost_limit) {
                        char ghost_limit[32];
 
-                       ret = sprintf(ghost_limit, "%lu", 
opts->user->ghost_limit);
+                       ret = sprintf(ghost_limit, "%"PRIu64, 
opts->user->ghost_limit);
                        if (ret < 0 || ret >= sizeof(ghost_limit)) {
-                               ERROR("failed to print ghost limit %lu", 
opts->user->ghost_limit);
+                               ERROR("failed to print ghost limit %"PRIu64, 
opts->user->ghost_limit);
                                goto err;
                        }
 
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to