From b4df082618f4495b602bf86b2e0452c00788ee96 Mon Sep 17 00:00:00 2001 From: Eric Katzfey Date: Fri, 25 Oct 2024 22:26:17 -0700 Subject: [PATCH] AP_RCProtocol: get rid of compiler warning from clang about unknown warning group -Wswitch-unreachable --- libraries/AP_RCProtocol/AP_RCProtocol.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/AP_RCProtocol/AP_RCProtocol.h b/libraries/AP_RCProtocol/AP_RCProtocol.h index 37f46a28da..bcf7038ba9 100644 --- a/libraries/AP_RCProtocol/AP_RCProtocol.h +++ b/libraries/AP_RCProtocol/AP_RCProtocol.h @@ -128,11 +128,13 @@ public: _disabled_for_pulses |= (1U<<(uint8_t)protocol); } +#if !defined(__clang__) // in the case we've disabled most backends then the "return true" in // the following method can never be reached, and the compiler gets // annoyed at that. #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wswitch-unreachable" +#endif // for protocols without strong CRCs we require 3 good frames to lock on bool requires_3_frames(enum rcprotocol_t p) { @@ -203,7 +205,9 @@ public: } return false; } +#if !defined(__clang__) #pragma GCC diagnostic pop +#endif uint8_t num_channels(); uint16_t read(uint8_t chan);