From: Sage Weil Date: Wed, 17 Oct 2018 22:22:42 +0000 (-0500) Subject: common,filestore: silence GCC-8 warnings X-Git-Tag: v12.2.11~131^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1005fcdb9c5fc767c30701668a5812e5fa2bcb4c;p=ceph.git common,filestore: silence GCC-8 warnings 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 --- 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(); \