]>
git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
common/ceph_context: use std::atomic<std::shared_ptr<T>>
Fixes the compiler warning:
src/common/ceph_context.h: In member function ‘std::shared_ptr<std::vector<entity_addrvec_t> > ceph::common::CephContext::get_mon_addrs() const’:
src/common/ceph_context.h:288:36: warning: ‘std::shared_ptr<_Tp> std::atomic_load_explicit(const shared_ptr<_Tp>*, memory_order) [with _Tp = vector<entity_addrvec_t>]’ is deprecated: use 'std::atomic<std::shared_ptr<T>>' instead [-Wdeprecated-declarations]
288 | auto ptr = atomic_load_explicit(&_mon_addrs, std::memory_order_relaxed);
| ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/shared_ptr_atomic.h:133:5: note: declared here
133 | atomic_load_explicit(const shared_ptr<_Tp>* __p, memory_order)
| ^~~~~~~~~~~~~~~~~~~~
The modernized version does not build with GCC 11, so this patch
contains both versions for now, switched by a `__GNUC__` preprocessor
check.
Signed-off-by: Max Kellermann <max.kellermann@ionos.com>