From 62382040ee9b655a68b15ccb43cebb39c9dc3a45 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 6 May 2018 14:39:18 +0800 Subject: [PATCH] common,filestore: silence GCC-8 warnings MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit should catch polymorphic exceptions by reference. this silences warnings like: error: catching polymorphic type ‘class std::RetryException’ by value [-Werror=catch-value=] } catch (std::RetryException) { Signed-off-by: Kefu Chai --- src/common/cmdparse.h | 2 +- src/mgr/DaemonState.h | 2 +- src/os/filestore/LFNIndex.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/cmdparse.h b/src/common/cmdparse.h index 808501387ba..bcd1943a7f3 100644 --- a/src/common/cmdparse.h +++ b/src/common/cmdparse.h @@ -54,7 +54,7 @@ cmd_getval(CephContext *cct, const cmdmap_t& cmdmap, const std::string& k, T& va try { val = boost::get(cmdmap.find(k)->second); return true; - } catch (boost::bad_get) { + } catch (boost::bad_get&) { handle_bad_get(cct, k, typeid(T).name()); } } diff --git a/src/mgr/DaemonState.h b/src/mgr/DaemonState.h index 3cbf8e52594..b2af6ec04e1 100644 --- a/src/mgr/DaemonState.h +++ b/src/mgr/DaemonState.h @@ -130,7 +130,7 @@ class DaemonState auto p = config_defaults_bl.begin(); try { decode(config_defaults, p); - } catch (buffer::error e) { + } catch (buffer::error& e) { } } return config_defaults; diff --git a/src/os/filestore/LFNIndex.h b/src/os/filestore/LFNIndex.h index bbab0d097be..2f2d2e0f8fe 100644 --- a/src/os/filestore/LFNIndex.h +++ b/src/os/filestore/LFNIndex.h @@ -63,7 +63,7 @@ out: \ complete_inject_failure(); \ return r; \ - } catch (RetryException) { \ + } catch (RetryException&) { \ failed = true; \ } catch (...) { \ ceph_abort(); \ -- 2.39.5