Skip to content

Commit

Permalink
AP_RCProtocol: get rid of compiler warning from clang about unknown w…
Browse files Browse the repository at this point in the history
…arning group -Wswitch-unreachable
  • Loading branch information
katzfey committed Oct 26, 2024
1 parent 9f4f646 commit 444624f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libraries/AP_RCProtocol/AP_RCProtocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,13 @@ class AP_RCProtocol {
_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) {
Expand Down

0 comments on commit 444624f

Please sign in to comment.