]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
include/denc: always initialize local variable
authorKefu Chai <kchai@redhat.com>
Tue, 27 Jul 2021 03:42:59 +0000 (11:42 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 27 Jul 2021 03:43:30 +0000 (11:43 +0800)
commit0edc573fcacb382e0de1b98446af6a214e291d26
treee3791ef79aab65e4ce8e38db5f6386688b278a0b
parentd7862cb6070094e611a031e5c8194235e2c503e6
include/denc: always initialize local variable

this change silences following false positive warning:

In file included from ../src/include/encoding.h:41,
                  from ../src/kv/KeyValueDB.h:12,
                  from ../src/os/bluestore/bluestore_common.h:20,
                  from ../src/os/bluestore/BlueFS.cc:5:
 ../src/include/denc.h: In function ‘std::enable_if_t<(is_same_v<T, bluefs_extent_t> || is_same_v<T, const bluefs_extent_t>)> _denc_friend(T&, P&) [with T = bluefs_extent_t; P = ceph::buffer::v15_2_0::p$
 ../src/include/denc.h:639:11: warning: ‘shift’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   639 |     shift += 7;
       |     ~~~~~~^~~~
 ../src/include/denc.h:613:7: note: ‘shift’ was declared here
   613 |   int shift;
       |       ^~~~~

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/include/denc.h