From c0ab2f91f8dcba61145c20f36e1ed8b6a5a0d6d1 Mon Sep 17 00:00:00 2001 From: Leif Hedstrom Date: Mon, 4 Sep 2023 16:42:29 -0600 Subject: [PATCH] Eliminate unreachable code covered by switch default This fixes #10361 and #10337 --- plugins/experimental/access_control/plugin.cc | 1 - plugins/experimental/cache_fill/cache_fill.cc | 1 - plugins/healthchecks/healthchecks.cc | 1 + plugins/prefetch/plugin.cc | 2 -- 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/plugins/experimental/access_control/plugin.cc b/plugins/experimental/access_control/plugin.cc index 3b2ad4e27e4..a71f1b6e8cd 100644 --- a/plugins/experimental/access_control/plugin.cc +++ b/plugins/experimental/access_control/plugin.cc @@ -77,7 +77,6 @@ getEventName(TSEvent event) default: return "UNHANDLED"; } - return "UNHANDLED"; } /** diff --git a/plugins/experimental/cache_fill/cache_fill.cc b/plugins/experimental/cache_fill/cache_fill.cc index 151cb8bb748..a3be30c675d 100644 --- a/plugins/experimental/cache_fill/cache_fill.cc +++ b/plugins/experimental/cache_fill/cache_fill.cc @@ -60,7 +60,6 @@ getCacheLookupResultName(TSCacheLookupResult result) return "UNKNOWN_CACHE_LOOKUP_EVENT"; break; } - return "UNKNOWN_CACHE_LOOKUP_EVENT"; } /////////////////////////////////////////////////////////////////////////// diff --git a/plugins/healthchecks/healthchecks.cc b/plugins/healthchecks/healthchecks.cc index 77a69b13164..a86e6451c5d 100644 --- a/plugins/healthchecks/healthchecks.cc +++ b/plugins/healthchecks/healthchecks.cc @@ -211,6 +211,7 @@ hc_thread(void *data ATS_UNUSED) if (len >= 0) { int i = 0; + /* coverity[ -tainted_data] */ while (i < len) { struct inotify_event *event = (struct inotify_event *)&buffer[i]; HCFileInfo *finfo = g_config; diff --git a/plugins/prefetch/plugin.cc b/plugins/prefetch/plugin.cc index fde298ec67e..6b731bdd257 100644 --- a/plugins/prefetch/plugin.cc +++ b/plugins/prefetch/plugin.cc @@ -76,7 +76,6 @@ getEventName(TSEvent event) default: return "UNHANDLED"; } - return "UNHANDLED"; } static const char * @@ -99,7 +98,6 @@ getCacheLookupResultName(TSCacheLookupResult result) return "UNKNOWN_CACHE_LOOKUP_EVENT"; break; } - return "UNKNOWN_CACHE_LOOKUP_EVENT"; } /**