]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd.cc: init 'snap_protected' to fix -Wconditional-uninitialized
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 8 May 2014 14:09:07 +0000 (16:09 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 8 May 2014 14:09:07 +0000 (16:09 +0200)
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 <danny.al-gaaf@bisect.de>
src/rbd.cc

index ccbc5319eeb57f9b66badf9dacb6a78751e24474..1bc721f43768b14d13119cefb22c8f8d7c760603 100644 (file)
@@ -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));