Clean up some instances of -Wunreachable-code-aggressive (#27054)

See https://github.com/grpc/grpc/pull/26951 for why this is not enforced
at the moment.
pull/27059/head
AJ Heller 3 years ago committed by GitHub
parent 724ad871d4
commit 4ba3fa52b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/core/ext/transport/cronet/transport/cronet_status.cc
  2. 2
      test/core/compression/message_compress_test.cc
  3. 3
      test/core/end2end/cq_verifier.cc
  4. 1
      test/core/util/subprocess_posix.cc
  5. 2
      test/cpp/end2end/server_crash_test_client.cc
  6. 2
      test/cpp/interop/xds_interop_client.cc
  7. 2
      test/cpp/qps/client_async.cc
  8. 2
      test/cpp/qps/qps_worker.cc

@ -304,7 +304,6 @@ const char* cronet_net_error_as_string(cronet_net_error_code net_error) {
return "CRONET_NET_ERROR_ENCODING_CONVERSION_FAILED";
case CRONET_NET_ERROR_UNRECOGNIZED_FTP_DIRECTORY_LISTING_FORMAT:
return "CRONET_NET_ERROR_UNRECOGNIZED_FTP_DIRECTORY_LISTING_FORMAT";
return "CRONET_NET_ERROR_INVALID_SPDY_STREAM";
case CRONET_NET_ERROR_NO_SUPPORTED_PROXIES:
return "CRONET_NET_ERROR_NO_SUPPORTED_PROXIES";
case CRONET_NET_ERROR_HTTP2_PROTOCOL_ERROR:
@ -339,7 +338,6 @@ const char* cronet_net_error_as_string(cronet_net_error_code net_error) {
return "CRONET_NET_ERROR_HTTP2_SERVER_REFUSED_STREAM";
case CRONET_NET_ERROR_HTTP2_PING_FAILED:
return "CRONET_NET_ERROR_HTTP2_PING_FAILED";
return "CRONET_NET_ERROR_PIPELINE_EVICTION";
case CRONET_NET_ERROR_CONTENT_LENGTH_MISMATCH:
return "CRONET_NET_ERROR_CONTENT_LENGTH_MISMATCH";
case CRONET_NET_ERROR_INCOMPLETE_CHUNKED_ENCODING:
@ -350,7 +348,6 @@ const char* cronet_net_error_as_string(cronet_net_error_code net_error) {
return "CRONET_NET_ERROR_RESPONSE_HEADERS_TRUNCATED";
case CRONET_NET_ERROR_QUIC_HANDSHAKE_FAILED:
return "CRONET_NET_ERROR_QUIC_HANDSHAKE_FAILED";
return "CRONET_NET_ERROR_REQUEST_FOR_SECURE_RESOURCE_OVER_INSECURE_QUIC";
case CRONET_NET_ERROR_HTTP2_INADEQUATE_TRANSPORT_SECURITY:
return "CRONET_NET_ERROR_HTTP2_INADEQUATE_TRANSPORT_SECURITY";
case CRONET_NET_ERROR_HTTP2_FLOW_CONTROL_ERROR:
@ -367,7 +364,6 @@ const char* cronet_net_error_as_string(cronet_net_error_code net_error) {
return "CRONET_NET_ERROR_PROXY_HTTP_1_1_REQUIRED";
case CRONET_NET_ERROR_PAC_SCRIPT_TERMINATED:
return "CRONET_NET_ERROR_PAC_SCRIPT_TERMINATED";
return "CRONET_NET_ERROR_TEMPORARY_BACKOFF";
case CRONET_NET_ERROR_INVALID_HTTP_RESPONSE:
return "CRONET_NET_ERROR_INVALID_HTTP_RESPONSE";
case CRONET_NET_ERROR_CONTENT_DECODING_INIT_FAILED:
@ -522,6 +518,4 @@ grpc_status_code cronet_net_error_to_grpc_error(
default:
return GRPC_STATUS_UNAVAILABLE;
}
return GRPC_STATUS_UNAVAILABLE;
}

@ -124,7 +124,6 @@ static compressability get_compressability(
return SHOULD_COMPRESS;
case TEST_VALUE_COUNT:
abort();
break;
}
return MAYBE_COMPRESSES;
}
@ -139,7 +138,6 @@ static grpc_slice create_test_value(test_value id) {
return repeated('a', 1024 * 1024);
case TEST_VALUE_COUNT:
abort();
break;
}
return grpc_slice_from_copied_string("bad value");
}

@ -209,7 +209,6 @@ std::string ExpectationString(const Expectation& e) {
case GRPC_QUEUE_SHUTDOWN:
gpr_log(GPR_ERROR, "not implemented");
abort();
break;
}
return out;
}
@ -243,11 +242,9 @@ static void verify_matches(const Expectation& e, const grpc_event& ev) {
case GRPC_QUEUE_SHUTDOWN:
gpr_log(GPR_ERROR, "premature queue shutdown");
abort();
break;
case GRPC_QUEUE_TIMEOUT:
gpr_log(GPR_ERROR, "not implemented");
abort();
break;
}
}

@ -60,7 +60,6 @@ gpr_subprocess* gpr_subprocess_create(int argc, const char** argv) {
/* if we reach here, an error has occurred */
gpr_log(GPR_ERROR, "execv '%s' failed: %s", exec_args[0], strerror(errno));
_exit(1);
return nullptr;
} else {
r = static_cast<gpr_subprocess*>(gpr_zalloc(sizeof(gpr_subprocess)));
r->pid = pid;

@ -68,6 +68,4 @@ int main(int argc, char** argv) {
absl::GetFlag(FLAGS_mode).c_str());
return 1;
}
return 0;
}

@ -506,7 +506,7 @@ void RunTestLoop(std::chrono::duration<double> duration_per_query,
}
}
}
thread.join();
GPR_UNREACHABLE_CODE(thread.join());
}
void RunServer(const int port, StatsWatchers* stats_watchers,

@ -822,7 +822,6 @@ class ClientRpcContextGenericStreamingImpl : public ClientRpcContext {
next_state_ = State::READ_DONE;
stream_->Read(&response_, ClientRpcContext::tag(this));
return true;
break;
case State::READ_DONE:
entry->set_value((UsageTimer::Now() - start_) * 1e9);
callback_(status_, &response_);
@ -841,7 +840,6 @@ class ClientRpcContextGenericStreamingImpl : public ClientRpcContext {
case State::FINISH_DONE:
next_state_ = State::INVALID;
return false;
break;
default:
GPR_ASSERT(false);
return false;

@ -67,7 +67,6 @@ static std::unique_ptr<Client> CreateClient(const ClientConfig& config) {
default:
abort();
}
abort();
}
static std::unique_ptr<Server> CreateServer(const ServerConfig& config) {
@ -86,7 +85,6 @@ static std::unique_ptr<Server> CreateServer(const ServerConfig& config) {
default:
abort();
}
abort();
}
class ScopedProfile final {

Loading…
Cancel
Save