From 5c95e22109695abec5b481e28428f1b153d932ff Mon Sep 17 00:00:00 2001 From: "Adam C. Emerson" Date: Thu, 16 Jul 2020 20:31:33 -0400 Subject: [PATCH] {tools,rbd,rados,rgw}: Fix Boost.Bind placeholder warning Use of the Boost placeholders in the default namespace is deprecated. Switching to defines them in boost::placeholders and silences the warning. Signed-off-by: Adam C. Emerson --- src/librbd/ImageCtx.cc | 1 - src/librbd/ImageWatcher.cc | 4 +++- src/librbd/Operations.cc | 4 +++- src/librbd/Watcher.cc | 4 +++- src/librbd/io/CopyupRequest.cc | 1 - src/librbd/io/ObjectRequest.cc | 1 - src/librbd/operation/TrimRequest.cc | 1 - src/mgr/PyModule.cc | 4 ++++ src/mgr/StandbyPyModules.cc | 2 ++ src/rbd_replay/BoundedBuffer.hpp | 2 +- src/rgw/rgw_op.cc | 1 - src/rgw/rgw_rest_s3.cc | 2 ++ src/test/librados_test_stub/TestWatchNotify.cc | 2 +- src/test/librbd/test_ImageWatcher.cc | 1 - src/tools/immutable_object_cache/CacheClient.cc | 1 + src/tools/immutable_object_cache/CacheClient.h | 1 - src/tools/immutable_object_cache/CacheServer.cc | 2 +- src/tools/immutable_object_cache/CacheSession.cc | 1 + src/tools/immutable_object_cache/CacheSession.h | 1 - src/tools/rbd/action/DiskUsage.cc | 3 ++- src/tools/rbd/action/List.cc | 3 ++- src/tools/rbd/action/Snap.cc | 4 +++- src/tools/rbd/action/Trash.cc | 3 ++- src/tools/rbd_mirror/NamespaceReplayer.cc | 1 - src/tools/rbd_mirror/PoolReplayer.cc | 1 - src/tools/rbd_mirror/PoolWatcher.cc | 1 - 26 files changed, 31 insertions(+), 21 deletions(-) diff --git a/src/librbd/ImageCtx.cc b/src/librbd/ImageCtx.cc index c5746f66eff80..f4ef804760517 100644 --- a/src/librbd/ImageCtx.cc +++ b/src/librbd/ImageCtx.cc @@ -36,7 +36,6 @@ #include "librbd/operation/ResizeRequest.h" #include "osdc/Striper.h" -#include #include #define dout_subsys ceph_subsys_rbd diff --git a/src/librbd/ImageWatcher.cc b/src/librbd/ImageWatcher.cc index 979f7a4b5a4be..88c1322dfdb0f 100644 --- a/src/librbd/ImageWatcher.cc +++ b/src/librbd/ImageWatcher.cc @@ -16,7 +16,7 @@ #include "librbd/io/AioCompletion.h" #include "include/encoding.h" #include "common/errno.h" -#include +#include #define dout_subsys ceph_subsys_rbd #undef dout_prefix @@ -33,6 +33,8 @@ using util::create_rados_callback; using ceph::encode; using ceph::decode; +using namespace boost::placeholders; + static const double RETRY_DELAY_SECONDS = 1.0; template diff --git a/src/librbd/Operations.cc b/src/librbd/Operations.cc index 751a250123a5b..7342b4d2d64fd 100644 --- a/src/librbd/Operations.cc +++ b/src/librbd/Operations.cc @@ -38,7 +38,7 @@ #include "librbd/operation/SnapshotLimitRequest.h" #include "librbd/operation/SparsifyRequest.h" #include -#include +#include #include #define dout_subsys ceph_subsys_rbd @@ -47,6 +47,8 @@ namespace librbd { +using namespace boost::placeholders; + namespace { template diff --git a/src/librbd/Watcher.cc b/src/librbd/Watcher.cc index 89d90c6599bc6..fef79533b2171 100644 --- a/src/librbd/Watcher.cc +++ b/src/librbd/Watcher.cc @@ -8,7 +8,7 @@ #include "librbd/asio/ContextWQ.h" #include "include/encoding.h" #include "common/errno.h" -#include +#include // re-include our assert to clobber the system one; fix dout: #include "include/ceph_assert.h" @@ -17,6 +17,8 @@ namespace librbd { +using namespace boost::placeholders; + using namespace watcher; using util::create_context_callback; diff --git a/src/librbd/io/CopyupRequest.cc b/src/librbd/io/CopyupRequest.cc index d41573d693112..58f0a2ce1a088 100644 --- a/src/librbd/io/CopyupRequest.cc +++ b/src/librbd/io/CopyupRequest.cc @@ -18,7 +18,6 @@ #include "librbd/io/ObjectRequest.h" #include "librbd/io/ReadResult.h" -#include #include #include diff --git a/src/librbd/io/ObjectRequest.cc b/src/librbd/io/ObjectRequest.cc index 51efbae21efb7..bacc6234b18eb 100644 --- a/src/librbd/io/ObjectRequest.cc +++ b/src/librbd/io/ObjectRequest.cc @@ -20,7 +20,6 @@ #include "librbd/io/ImageRequest.h" #include "librbd/io/ReadResult.h" -#include #include #define dout_subsys ceph_subsys_rbd diff --git a/src/librbd/operation/TrimRequest.cc b/src/librbd/operation/TrimRequest.cc index 0fcb7af034bd7..63c0b232bbd94 100644 --- a/src/librbd/operation/TrimRequest.cc +++ b/src/librbd/operation/TrimRequest.cc @@ -15,7 +15,6 @@ #include "common/errno.h" #include "osdc/Striper.h" -#include #include #include #include diff --git a/src/mgr/PyModule.cc b/src/mgr/PyModule.cc index 3f3fbbd53d5fd..365c3e3cd9bbc 100644 --- a/src/mgr/PyModule.cc +++ b/src/mgr/PyModule.cc @@ -31,7 +31,11 @@ std::string PyModule::config_prefix = "mgr/"; // Courtesy of http://stackoverflow.com/questions/1418015/how-to-get-python-exception-text +#define BOOST_BIND_GLOBAL_PLACEHOLDERS +// Boost apparently can't be bothered to fix its own usage of its own +// deprecated features. #include +#undef BOOST_BIND_GLOBAL_PLACEHOLDERS #include #include "include/ceph_assert.h" // boost clobbers this // decode a Python exception into a string diff --git a/src/mgr/StandbyPyModules.cc b/src/mgr/StandbyPyModules.cc index 8537cfde48077..5d71f46949ade 100644 --- a/src/mgr/StandbyPyModules.cc +++ b/src/mgr/StandbyPyModules.cc @@ -21,7 +21,9 @@ #include "mgr/Gil.h" +#define BOOST_BIND_GLOBAL_PLACEHOLDERS #include +#undef BOOST_BIND_GLOBAL_PLACEHOLDERS #include "include/ceph_assert.h" // boost clobbers this // For ::config_prefix diff --git a/src/rbd_replay/BoundedBuffer.hpp b/src/rbd_replay/BoundedBuffer.hpp index e4df483c1f673..00fb1cb32344d 100644 --- a/src/rbd_replay/BoundedBuffer.hpp +++ b/src/rbd_replay/BoundedBuffer.hpp @@ -4,7 +4,7 @@ #ifndef _INCLUDED_BOUNDED_BUFFER_HPP #define _INCLUDED_BOUNDED_BUFFER_HPP -#include +#include #include #include #include diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 0958f2871edb9..57acbbdf1e3f3 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -10,7 +10,6 @@ #include #include -#include #include #include diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 90c4903b8d8b0..96d863296618e 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -17,7 +17,9 @@ #include #include #include +#define BOOST_BIND_GLOBAL_PLACEHOLDERS #include +#undef BOOST_BIND_GLOBAL_PLACEHOLDERS #include diff --git a/src/test/librados_test_stub/TestWatchNotify.cc b/src/test/librados_test_stub/TestWatchNotify.cc index 9da9971fa802c..4c43090ca1a2f 100644 --- a/src/test/librados_test_stub/TestWatchNotify.cc +++ b/src/test/librados_test_stub/TestWatchNotify.cc @@ -8,7 +8,7 @@ #include "common/Finisher.h" #include "test/librados_test_stub/TestCluster.h" #include "test/librados_test_stub/TestRadosClient.h" -#include +#include #include #include "include/ceph_assert.h" diff --git a/src/test/librbd/test_ImageWatcher.cc b/src/test/librbd/test_ImageWatcher.cc index 209133e9ec662..a3cdfdb5e3410 100644 --- a/src/test/librbd/test_ImageWatcher.cc +++ b/src/test/librbd/test_ImageWatcher.cc @@ -20,7 +20,6 @@ #include "gtest/gtest.h" #include #include -#include #include #include #include diff --git a/src/tools/immutable_object_cache/CacheClient.cc b/src/tools/immutable_object_cache/CacheClient.cc index 45dae6b88fd2c..bbacf5e208fa8 100644 --- a/src/tools/immutable_object_cache/CacheClient.cc +++ b/src/tools/immutable_object_cache/CacheClient.cc @@ -1,6 +1,7 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#include #include "CacheClient.h" #include "common/Cond.h" diff --git a/src/tools/immutable_object_cache/CacheClient.h b/src/tools/immutable_object_cache/CacheClient.h index 3294e56048ab2..e1e9a65927d43 100644 --- a/src/tools/immutable_object_cache/CacheClient.h +++ b/src/tools/immutable_object_cache/CacheClient.h @@ -6,7 +6,6 @@ #include #include -#include #include #include diff --git a/src/tools/immutable_object_cache/CacheServer.cc b/src/tools/immutable_object_cache/CacheServer.cc index 7e68d7e875159..e1ec1c74b7cb5 100644 --- a/src/tools/immutable_object_cache/CacheServer.cc +++ b/src/tools/immutable_object_cache/CacheServer.cc @@ -1,7 +1,7 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab -#include +#include #include "common/debug.h" #include "common/ceph_context.h" #include "CacheServer.h" diff --git a/src/tools/immutable_object_cache/CacheSession.cc b/src/tools/immutable_object_cache/CacheSession.cc index 5bf730354ab3e..6d8daf05be1f5 100644 --- a/src/tools/immutable_object_cache/CacheSession.cc +++ b/src/tools/immutable_object_cache/CacheSession.cc @@ -1,6 +1,7 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#include #include "common/debug.h" #include "common/ceph_context.h" #include "CacheSession.h" diff --git a/src/tools/immutable_object_cache/CacheSession.h b/src/tools/immutable_object_cache/CacheSession.h index d530b529c8c22..3cc4d9ed8004e 100644 --- a/src/tools/immutable_object_cache/CacheSession.h +++ b/src/tools/immutable_object_cache/CacheSession.h @@ -4,7 +4,6 @@ #ifndef CEPH_CACHE_SESSION_H #define CEPH_CACHE_SESSION_H -#include #include #include diff --git a/src/tools/rbd/action/DiskUsage.cc b/src/tools/rbd/action/DiskUsage.cc index 0e8f0590383fd..12fb8cfde960e 100644 --- a/src/tools/rbd/action/DiskUsage.cc +++ b/src/tools/rbd/action/DiskUsage.cc @@ -11,7 +11,7 @@ #include "common/TextTable.h" #include #include -#include +#include #include namespace rbd { @@ -20,6 +20,7 @@ namespace disk_usage { namespace at = argument_types; namespace po = boost::program_options; +using namespace boost::placeholders; static int disk_usage_callback(uint64_t offset, size_t len, int exists, void *arg) { diff --git a/src/tools/rbd/action/List.cc b/src/tools/rbd/action/List.cc index 67d9e4f841420..b42695b31b3c4 100644 --- a/src/tools/rbd/action/List.cc +++ b/src/tools/rbd/action/List.cc @@ -11,7 +11,7 @@ #include "common/Formatter.h" #include "common/TextTable.h" #include -#include +#include #include #include "global/global_context.h" @@ -22,6 +22,7 @@ namespace list { namespace at = argument_types; namespace po = boost::program_options; +using namespace boost::placeholders; enum WorkerState { STATE_IDLE = 0, diff --git a/src/tools/rbd/action/Snap.cc b/src/tools/rbd/action/Snap.cc index b2011ebae23f5..e8a9cb1b8d1c0 100644 --- a/src/tools/rbd/action/Snap.cc +++ b/src/tools/rbd/action/Snap.cc @@ -11,12 +11,14 @@ #include "common/TextTable.h" #include #include -#include +#include namespace rbd { namespace action { namespace snap { +using namespace boost::placeholders; + static const std::string ALL_NAME("all"); namespace at = argument_types; diff --git a/src/tools/rbd/action/Trash.cc b/src/tools/rbd/action/Trash.cc index 1b7721a59bd3d..b1e0de132f174 100644 --- a/src/tools/rbd/action/Trash.cc +++ b/src/tools/rbd/action/Trash.cc @@ -23,11 +23,12 @@ #include #include #include -#include +#include namespace rbd { namespace action { namespace trash { +using namespace boost::placeholders; namespace at = argument_types; namespace po = boost::program_options; diff --git a/src/tools/rbd_mirror/NamespaceReplayer.cc b/src/tools/rbd_mirror/NamespaceReplayer.cc index 10382c914b6e3..d86514967ed9f 100644 --- a/src/tools/rbd_mirror/NamespaceReplayer.cc +++ b/src/tools/rbd_mirror/NamespaceReplayer.cc @@ -2,7 +2,6 @@ // vim: ts=8 sw=2 smarttab #include "NamespaceReplayer.h" -#include #include "common/Formatter.h" #include "common/debug.h" #include "common/errno.h" diff --git a/src/tools/rbd_mirror/PoolReplayer.cc b/src/tools/rbd_mirror/PoolReplayer.cc index 75067813aa59d..42018d5d548a5 100644 --- a/src/tools/rbd_mirror/PoolReplayer.cc +++ b/src/tools/rbd_mirror/PoolReplayer.cc @@ -2,7 +2,6 @@ // vim: ts=8 sw=2 smarttab #include "PoolReplayer.h" -#include #include "common/Cond.h" #include "common/Formatter.h" #include "common/admin_socket.h" diff --git a/src/tools/rbd_mirror/PoolWatcher.cc b/src/tools/rbd_mirror/PoolWatcher.cc index 9fa8e88811d06..c6d68ecd4e1c9 100644 --- a/src/tools/rbd_mirror/PoolWatcher.cc +++ b/src/tools/rbd_mirror/PoolWatcher.cc @@ -16,7 +16,6 @@ #include "librbd/asio/ContextWQ.h" #include "tools/rbd_mirror/Threads.h" #include "tools/rbd_mirror/pool_watcher/RefreshImagesRequest.h" -#include #define dout_context g_ceph_context #define dout_subsys ceph_subsys_rbd_mirror -- 2.39.5