From 1005fcdb9c5fc767c30701668a5812e5fa2bcb4c Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 17 Oct 2018 17:22:42 -0500 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 (cherry picked from commit 62382040ee9b655a68b15ccb43cebb39c9dc3a45) # Conflicts: # src/mgr/DaemonState.h - skipped mgr/DaemonState.h, which is new code --- src/common/cmdparse.h | 2 +- src/os/filestore/LFNIndex.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/cmdparse.h b/src/common/cmdparse.h index 41495f5551a2..985fdddafb51 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/os/filestore/LFNIndex.h b/src/os/filestore/LFNIndex.h index bbab0d097be0..2f2d2e0f8fea 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.47.3