From: Kefu Chai Date: Sun, 6 May 2018 06:39:18 +0000 (+0800) Subject: common,filestore: silence GCC-8 warnings X-Git-Tag: v13.1.1~21^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=64bcbf52bf722d052c37aafa95c54e774c345de4;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) --- diff --git a/src/common/cmdparse.h b/src/common/cmdparse.h index 808501387baa..bcd1943a7f3a 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 3cbf8e525945..b2af6ec04e1e 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 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(); \