qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject [1/3] qpid-proton git commit: PROTON-1279: [C++ binding] Turn off unreachable warning for clang for code where it is intentional
Date Thu, 11 Aug 2016 17:31:43 GMT
Repository: qpid-proton
Updated Branches:
  refs/heads/0.14.x 43461aa03 -> 5bd761b07


PROTON-1279: [C++ binding] Turn off unreachable warning for clang for code where it is intentional


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/a77eaf2b
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/a77eaf2b
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/a77eaf2b

Branch: refs/heads/0.14.x
Commit: a77eaf2b53409292d714079ac2df2b13f02fd4dc
Parents: 43461aa
Author: Andrew Stitcher <astitcher@apache.org>
Authored: Fri Aug 5 18:14:21 2016 -0400
Committer: Andrew Stitcher <astitcher@apache.org>
Committed: Thu Aug 11 13:26:13 2016 -0400

----------------------------------------------------------------------
 proton-c/bindings/cpp/src/type_id.cpp | 10 +++++++++-
 proton-c/bindings/cpp/src/value.cpp   |  8 ++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/a77eaf2b/proton-c/bindings/cpp/src/type_id.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/type_id.cpp b/proton-c/bindings/cpp/src/type_id.cpp
index 0108e5a..b28a6e8 100644
--- a/proton-c/bindings/cpp/src/type_id.cpp
+++ b/proton-c/bindings/cpp/src/type_id.cpp
@@ -53,7 +53,15 @@ std::string type_name(type_id t) {
       case LIST: return "list";
       case  MAP: return "map";
     }
-    return "unknown";
+// Avoid unreached diagnostic from clang
+#if defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunreachable-code"
+#endif
+     return "unknown";
+#if defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
 }
 
 std::ostream& operator<<(std::ostream& o, type_id t) { return o << type_name(t);
}

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/a77eaf2b/proton-c/bindings/cpp/src/value.cpp
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/src/value.cpp b/proton-c/bindings/cpp/src/value.cpp
index 7e7afc5..c223243 100644
--- a/proton-c/bindings/cpp/src/value.cpp
+++ b/proton-c/bindings/cpp/src/value.cpp
@@ -141,8 +141,16 @@ int compare_next(decoder& a, decoder& b) {
       case STRING: return compare_simple<std::string>(a, b);
       case SYMBOL: return compare_simple<symbol>(a, b);
     }
+// Avoid unreached diagnostic from clang
+#if defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunreachable-code"
+#endif    
     // Invalid but equal type_id, treat as equal.
     return 0;
+#if defined(__clang__)
+#pragma GCC diagnostic pop
+#endif    
 }
 
 int compare(const value& x, const value& y) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message