]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
common,filestore: silence GCC-8 warnings
authorKefu Chai <kchai@redhat.com>
Sun, 6 May 2018 06:39:18 +0000 (14:39 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 6 May 2018 07:26:14 +0000 (15:26 +0800)
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 <kchai@redhat.com>
src/common/cmdparse.h
src/mgr/DaemonState.h
src/os/filestore/LFNIndex.h

index 808501387baa74e565813dc0a65bcecd6f24e38b..bcd1943a7f3a024146f0b37cb74cb5c12822c45f 100644 (file)
@@ -54,7 +54,7 @@ cmd_getval(CephContext *cct, const cmdmap_t& cmdmap, const std::string& k, T& va
     try {
       val = boost::get<T>(cmdmap.find(k)->second);
       return true;
-    } catch (boost::bad_get) {
+    } catch (boost::bad_get&) {
       handle_bad_get(cct, k, typeid(T).name());
     }
   }
index 3cbf8e5259455955935e1202ba5b91e21d11dcfc..b2af6ec04e1e96ade0c534cc20a9f5a2ea1b4da9 100644 (file)
@@ -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;
index bbab0d097be0e1705aab5dd61c5c58a6be21d3a9..2f2d2e0f8feab27a9972d2a94cd292aba44009b6 100644 (file)
@@ -63,7 +63,7 @@
       out:                                     \
       complete_inject_failure();               \
       return r;                                        \
-    } catch (RetryException) {                 \
+    } catch (RetryException&) {                        \
       failed = true;                           \
     } catch (...) {                            \
       ceph_abort();                            \