From: Danny Al-Gaaf Date: Thu, 8 May 2014 14:09:07 +0000 (+0200) Subject: rbd.cc: init 'snap_protected' to fix -Wconditional-uninitialized X-Git-Tag: v0.81~45^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=082367e8b2dba2899b9095d0b093d9f03258ecb8;p=ceph.git rbd.cc: init 'snap_protected' to fix -Wconditional-uninitialized Init 'snap_protected' with false to fix: rbd.cc:544:35: warning: variable 'snap_protected' may be uninitialized when used here [-Wconditional-uninitialized] f->dump_string("protected", snap_protected ? "true" : "false"); ^~~~~~~~~~~~~~ rbd.cc:482:22: note: initialize the variable 'snap_protected' to silence this warning bool snap_protected; ^ = false Signed-off-by: Danny Al-Gaaf --- diff --git a/src/rbd.cc b/src/rbd.cc index ccbc5319eeb5..1bc721f43768 100644 --- a/src/rbd.cc +++ b/src/rbd.cc @@ -479,7 +479,7 @@ static int do_show_info(const char *imgname, librbd::Image& image, string parent_pool, parent_name, parent_snapname; uint8_t old_format; uint64_t overlap, features; - bool snap_protected; + bool snap_protected = false; int r; r = image.stat(info, sizeof(info));