From: Robin Dong <san...@taobao.com> It will report warning:
node.c: In function ‘node_stat’: node.c:278: warning: ‘last.r.peer_total_rx’ may be used uninitialized in this function node.c:278: warning: ‘last.r.peer_total_tx’ may be used uninitialized in this function node.c:278: warning: ‘last.r.peer_total_nr’ may be used uninitialized in this function node.c:278: warning: ‘last.r.gway_total_rx’ may be used uninitialized in this function node.c:278: warning: ‘last.r.gway_total_tx’ may be used uninitialized in this function node.c:278: warning: ‘last.r.gway_total_nr’ may be used uninitialized in this function when compiling sheepdog. The reason is we forget to initialize argument 'last'. Signed-off-by: Robin Dong <san...@taobao.com> Signed-off-by: Liu Yuan <namei.u...@gmail.com> --- dog/node.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/dog/node.c b/dog/node.c index c72b39d..a9799ff 100644 --- a/dog/node.c +++ b/dog/node.c @@ -297,7 +297,7 @@ static int node_stat(int argc, char **argv) { struct sd_req hdr; struct sd_rsp *rsp = (struct sd_rsp *)&hdr; - struct sd_stat stat, last; + struct sd_stat stat, last = { { 0 } }; int ret; bool watch = node_cmd_data.watch ? true : false, first = true; -- 1.7.1 -- sheepdog mailing list sheepdog@lists.wpkg.org http://lists.wpkg.org/mailman/listinfo/sheepdog