diff --git a/cql3/constants.cc b/cql3/constants.cc index aef6f39cf9..f757b992d1 100644 --- a/cql3/constants.cc +++ b/cql3/constants.cc @@ -61,6 +61,7 @@ operator<<(std::ostream&out, constants::type t) case constants::type::DURATION: return out << "DURATION"; }; assert(0); + return out << "UNKOWN"; } bytes diff --git a/db/schema_tables.cc b/db/schema_tables.cc index bc556cbe0e..17b08c092c 100644 --- a/db/schema_tables.cc +++ b/db/schema_tables.cc @@ -620,6 +620,7 @@ future query_partition_mutation(service::storage_proxy& proxy, return partitions[0].mut().unfreeze(s); } else { assert(false && "Results must have at most one partition"); + throw std::invalid_argument("Results must have at most one partition"); } }); }); diff --git a/dht/byte_ordered_partitioner.cc b/dht/byte_ordered_partitioner.cc index a5e34eff1f..5bad539904 100644 --- a/dht/byte_ordered_partitioner.cc +++ b/dht/byte_ordered_partitioner.cc @@ -160,6 +160,7 @@ byte_ordered_partitioner::shard_of(const token& t) const { return (uint8_t(t._data[0]) * _shard_count) >> 8; } assert(0); + throw std::invalid_argument("invalid token"); } token @@ -177,6 +178,7 @@ byte_ordered_partitioner::token_for_next_shard(const token& t, shard_id shard, u return token(token::kind::key, managed_bytes({int8_t(e)})); } assert(0); + throw std::invalid_argument("invalid token"); } diff --git a/dht/murmur3_partitioner.cc b/dht/murmur3_partitioner.cc index ca4a0a7803..5684ee9fc5 100644 --- a/dht/murmur3_partitioner.cc +++ b/dht/murmur3_partitioner.cc @@ -255,6 +255,7 @@ murmur3_partitioner::shard_of(const token& t) const { return zero_based_shard_of(adjusted, _shard_count, _sharding_ignore_msb_bits); } assert(0); + throw std::invalid_argument("invalid token"); } token diff --git a/dht/random_partitioner.cc b/dht/random_partitioner.cc index ec5d261cd9..19715778c1 100644 --- a/dht/random_partitioner.cc +++ b/dht/random_partitioner.cc @@ -220,6 +220,7 @@ unsigned random_partitioner::shard_of(const token& t) const { return smp; } assert(0); + throw std::invalid_argument("invalid token"); } token @@ -240,6 +241,7 @@ random_partitioner::token_for_next_shard(const token& t, shard_id shard, unsigne return cppint_to_token(t.convert_to()); } assert(0); + throw std::invalid_argument("invalid token"); } diff --git a/position_in_partition.hh b/position_in_partition.hh index 765a1a73a6..2b60a26511 100644 --- a/position_in_partition.hh +++ b/position_in_partition.hh @@ -36,6 +36,7 @@ lexicographical_relation relation_for_lower_bound(composite_view v) { return lexicographical_relation::after_all_prefixed; default: assert(0); + throw std::invalid_argument("invalid composite_view"); } } diff --git a/schema_registry.cc b/schema_registry.cc index dd0a12cf1b..2bdee0c02e 100644 --- a/schema_registry.cc +++ b/schema_registry.cc @@ -235,6 +235,7 @@ future<> schema_registry_entry::maybe_sync(std::function()> syncer) { } default: assert(0); + throw std::logic_error("invalid _sync_state"); } } diff --git a/sstables/compress.hh b/sstables/compress.hh index 22d3025999..d2f9d40e24 100644 --- a/sstables/compress.hh +++ b/sstables/compress.hh @@ -177,6 +177,7 @@ struct compression { const_iterator& operator=(const const_iterator& other) { assert(&_offsets == &other._offsets); _index = other._index; + return *this; } const_iterator operator++(int) { diff --git a/unimplemented.cc b/unimplemented.cc index 2a11b1b9de..23e7373312 100644 --- a/unimplemented.cc +++ b/unimplemented.cc @@ -64,6 +64,7 @@ std::ostream& operator<<(std::ostream& out, cause c) { case cause::VIEWS: return out << "MATERIALIZED_VIEWS"; } assert(0); + return out << "UNKNOWN_CAUSE"; } void warn(cause c) {