qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject [3/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 16:10:30 GMT
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/a3134522
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/a3134522
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/a3134522

Branch: refs/heads/master
Commit: a3134522704656f70125eb38cfd2944c0657e871
Parents: e23688e
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 12:09:52 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/a3134522/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/a3134522/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