kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject [1/4] kudu git commit: remove control flow warnings
Date Thu, 24 Aug 2017 01:05:32 GMT
Repository: kudu
Updated Branches:
  refs/heads/master a9d17c00a -> 55c40fc72


remove control flow warnings

This patch eliminates two -Wreturn-type warnings by adding default switch
statements that crash.

  ../../src/kudu/consensus/consensus_meta.cc: In member function ‘const kudu::consensus::RaftConfigPB&
kudu::consensus::ConsensusMetadata::config_unlocked(kudu::consensus::RaftConfigState) const’:
  ../../src/kudu/consensus/consensus_meta.cc:136:1: warning: control reaches end of non-void
function [-Wreturn-type]
   }

  ../../src/kudu/integration-tests/fuzz-itest.cc: In function ‘TestOpType kudu::tablet::PickOpAtRandom(kudu::tablet::TestOpSets)’:
  ../../src/kudu/integration-tests/fuzz-itest.cc:477:1: warning: control reaches end of non-void
function [-Wreturn-type]
   }

Change-Id: I45ca805bc7db2e234f55d2c59efcf01a28593e12
Reviewed-on: http://gerrit.cloudera.org:8080/7794
Reviewed-by: Mike Percy <mpercy@apache.org>
Tested-by: Adar Dembo <adar@cloudera.com>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/145c01da
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/145c01da
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/145c01da

Branch: refs/heads/master
Commit: 145c01da49037e9999d057898891dee0734afd93
Parents: a9d17c0
Author: Adar Dembo <adar@cloudera.com>
Authored: Wed Aug 23 16:42:54 2017 -0700
Committer: Adar Dembo <adar@cloudera.com>
Committed: Thu Aug 24 00:47:45 2017 +0000

----------------------------------------------------------------------
 src/kudu/consensus/consensus_meta.cc     | 1 +
 src/kudu/integration-tests/fuzz-itest.cc | 2 ++
 2 files changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/145c01da/src/kudu/consensus/consensus_meta.cc
----------------------------------------------------------------------
diff --git a/src/kudu/consensus/consensus_meta.cc b/src/kudu/consensus/consensus_meta.cc
index 11a27a0..b2d53b0 100644
--- a/src/kudu/consensus/consensus_meta.cc
+++ b/src/kudu/consensus/consensus_meta.cc
@@ -132,6 +132,7 @@ const RaftConfigPB& ConsensusMetadata::config_unlocked(RaftConfigState
type) con
     case ACTIVE_CONFIG: return active_config_unlocked();
     case COMMITTED_CONFIG: return committed_config_unlocked();
     case PENDING_CONFIG: return pending_config_unlocked();
+    default: LOG(FATAL) << "Unknown RaftConfigState type: " << type;
   }
 }
 

http://git-wip-us.apache.org/repos/asf/kudu/blob/145c01da/src/kudu/integration-tests/fuzz-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/fuzz-itest.cc b/src/kudu/integration-tests/fuzz-itest.cc
index 17bee5c..7ba9bb9 100644
--- a/src/kudu/integration-tests/fuzz-itest.cc
+++ b/src/kudu/integration-tests/fuzz-itest.cc
@@ -473,6 +473,8 @@ TestOpType PickOpAtRandom(TestOpSets sets) {
       return kAllOps[rand() % kAllOps.size()];
     case PK_ONLY:
       return kPkOnlyOps[rand() % kPkOnlyOps.size()];
+    default:
+      LOG(FATAL) << "Unknown TestOpSets type: " << sets;
   }
 }
 


Mime
View raw message