New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
client,common,mgr,rbd: clang related cleanups #33657
Conversation
as the `*` operator of xlist::iterator always returns a copy not a reference, so there is no point to use `auto&` here. and clang complains at seeing this. so, use `&&` instead, to silence this warning. Signed-off-by: Kefu Chai <kchai@redhat.com>
@tchaikov
|
to initialize an array with desginators is a C99 feature, strictly speaking we cannot use this in C++. so clang complains at seeing this. in this change we use plain C string instead of using an lookup table for these constants. Signed-off-by: Kefu Chai <kchai@redhat.com>
this addresses the FTBFS like ``` home/jenkins/workspace/ceph-master/src/mgr/MgrCap.h:12:1: error: declaration conflicts with target of using declaration already in scope class CephContext; ^ /home/jenkins/workspace/ceph-master/src/include/common_fwd.h:10:9: note: target of using declaration class CephContext; ^ /home/jenkins/workspace/ceph-master/src/include/common_fwd.h:22:24: note: using declaration using TOPNSPC::common::CephContext; ^ In file included from /home/jenkins/workspace/ceph-master/src/mgr/MgrCap.cc:24: ``` Signed-off-by: Kefu Chai <kchai@redhat.com>
@wjwithagen fixed and repushed. |
This comment has been minimized.
This comment has been minimized.
@wjwithagen thanks for testing. i fixed the issue and repushed. @dillaman hi Jason, i piggy backed a couple of cleanups in this PR. could you help take a look at them? |
this addresses the FTBFS caused by ``` /home/jenkins/workspace/ceph-master/src/tools/rbd_mirror/PoolMetaCache.h:12:1: error: declaration conflicts with target of using declaration already in scope struct CephContext; ^ /home/jenkins/workspace/ceph-master/src/include/common_fwd.h:10:9: note: target of using declaration class CephContext; ^ /home/jenkins/workspace/ceph-master/src/include/common_fwd.h:22:24: note: using declaration using TOPNSPC::common::CephContext; ^ In file included from /home/jenkins/workspace/ceph-master/src/tools/rbd_mirror/PoolMetaCache.cc:6: /home/jenkins/workspace/ceph-master/src/tools/rbd_mirror/PoolMetaCache.h:19:17: error: reference to 'CephContext' is ambiguous PoolMetaCache(CephContext* cct) ^ ``` Signed-off-by: Kefu Chai <kchai@redhat.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes my issues I had with #31041
clang complains as `include/common_fwd.h` declares in a different way Signed-off-by: Kefu Chai <kchai@redhat.com>
this silences warning from clang-11, like ``` ../src/test/rbd_mirror/test_mock_ImageReplayer.cc:322:26: warning: lambda capture 'mock_replayer' is not used [-Wunused-lambda-capture] .WillOnce(Invoke([&mock_replayer, r](Context* ctx) { ~^~~~~~~~~~~~~~ ``` Signed-off-by: Kefu Chai <kchai@redhat.com>
`TYPED_TEST_CASE` is deprecated. let's use `TYPED_TEST_SUITE` instead. this silences the warning from gtest. ``` ../src/test/rbd_mirror/test_ImageReplayer.cc:584:1: warning: 'TypedTestCaseIsDeprecated' is deprecated: TYPED_TEST_CASE is deprecated, please use TYPED_TEST_SUITE [-Wdeprecated-declarations] TYPED_TEST_CASE(TestImageReplayer, TestImageReplayerTypes); ^ ../src/googletest/googletest/include/gtest/gtest-typed-test.h:229:38: note: expanded from macro 'TYPED_TEST_CASE' static_assert(::testing::internal::TypedTestCaseIsDeprecated(), ""); \ ^ ../src/googletest/googletest/include/gtest/internal/gtest-internal.h:1246:1: note: 'TypedTestCaseIsDeprecated' has been explicitly marked deprecated here GTEST_INTERNAL_DEPRECATED( ^ ../src/googletest/googletest/include/gtest/internal/gtest-port.h:2216:59: note: expanded from macro 'GTEST_INTERNAL_DEPRECATED' ^ ``` Signed-off-by: Kefu Chai <kchai@redhat.com>
this silences the warning from clang-11, like ``` ../src/librbd/image/RefreshRequest.cc:34:16: warning: unused variable 'MAX_METADATA_ITEMS' [-Wunused-const-variable] const uint64_t MAX_METADATA_ITEMS = 128; ^ ``` Signed-off-by: Kefu Chai <kchai@redhat.com>
@dillaman i reverted the reordering changes and updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm -- thx!
jenkins test make check |
(failed in |
jenkins test make check |
the failure were either
|
Since its "parent" PR is backported to Octopus, this one also needs to be backported. |
The octopus branch will be reset to master — they haven’t truly been split yet. |
Edit: after checking this further, I don't see how it could be related. https://tracker.ceph.com/issues/44430 Seeing this failure:
This PR is the likely cause. |
Checklist
Show available Jenkins commands
jenkins retest this please
jenkins test crimson perf
jenkins test signed
jenkins test make check
jenkins test make check arm64
jenkins test submodules
jenkins test dashboard
jenkins test dashboard backend
jenkins test docs
jenkins render docs
jenkins test ceph-volume all
jenkins test ceph-volume tox