]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common,filestore: silence GCC-8 warnings 24648/head
authorSage Weil <sage@redhat.com>
Wed, 17 Oct 2018 22:22:42 +0000 (17:22 -0500)
committerSage Weil <sage@redhat.com>
Wed, 17 Oct 2018 22:22:42 +0000 (17:22 -0500)
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>
(cherry picked from commit 62382040ee9b655a68b15ccb43cebb39c9dc3a45)

# Conflicts:
# src/mgr/DaemonState.h
- skipped mgr/DaemonState.h, which is new code

src/common/cmdparse.h
src/os/filestore/LFNIndex.h

index 41495f5551a283c3628c86b608fdf3e13216931c..985fdddafb519a475fda12f5d9d1108dfe300975 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 bbab0d097be0e1705aab5dd61c5c58a6be21d3a9..2f2d2e0f8feab27a9972d2a94cd292aba44009b6 100644 (file)
@@ -63,7 +63,7 @@
       out:                                     \
       complete_inject_failure();               \
       return r;                                        \
-    } catch (RetryException) {                 \
+    } catch (RetryException&) {                        \
       failed = true;                           \
     } catch (...) {                            \
       ceph_abort();                            \