]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rgw/auth: perm_mask uses std::optional 43829/head
authorCasey Bodley <cbodley@redhat.com>
Fri, 5 Nov 2021 20:02:17 +0000 (16:02 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 5 Nov 2021 20:17:28 +0000 (16:17 -0400)
commit578b43e8d5cc22a47bcb3efd0168544f03cb801c
tree4ea5b5a2ad702fdb8b04dd6cec7027af609c98f4
parent1460024d618feb6925ed5bd00fcbd85e90612d45
rgw/auth: perm_mask uses std::optional

resolves a compiler warning about an uninitialized variable in
boost::optional:

In file included from ../src/rgw/rgw_common.h:1508,
                 from ../src/rgw/rgw_main.cc:18:
../src/rgw/rgw_auth.h: In member function ‘virtual rgw::auth::swift::DefaultStrategy::aplptr_t rgw::auth::swift::DefaultStrategy::_ZThn56_NK3rgw4auth5swift15D
efaultStrategy15create_apl_turlEPN4ceph6common11CephContextEPK9req_stateRK11RGWUserInfo(ceph::common::CephContext*, const req_state*, const RGWUserInfo&) cons
t’:
../src/rgw/rgw_auth.h:652:38: warning: ‘<unnamed>.boost::optional<unsigned int>::<unnamed>.boost::optional_detail::tc_optional_base<unsigned int>::m_storage’
may be used uninitialized [-Wmaybe-uninitialized]
  652 |       this->perm_mask = perm_mask.get();
      |                         ~~~~~~~~~~~~~^~
In file included from ../src/rgw/rgw_rest_swift.h:14,
                 from ../src/rgw/rgw_main.cc:24:
../src/rgw/rgw_swift_auth.h:27:73: note: ‘<anonymous>’ declared here
   27 |     : LocalApplier(cct, user_info, LocalApplier::NO_SUBUSER, boost::none) {
      |

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_auth.cc
src/rgw/rgw_auth.h
src/rgw/rgw_auth_s3.h
src/rgw/rgw_rest_s3.cc
src/rgw/rgw_swift_auth.cc
src/rgw/rgw_swift_auth.h