From 8f95caafe8f20cf73fff7d27a597d6c8b1c5f0de Mon Sep 17 00:00:00 2001 From: Eric Katzfey Date: Wed, 11 Dec 2024 20:20:07 -0800 Subject: [PATCH] GCS_MAVLink: Remove pragma to disable compiler warning and instead cast enum to int to fix the code. --- libraries/GCS_MAVLink/GCS_MAVLink.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libraries/GCS_MAVLink/GCS_MAVLink.h b/libraries/GCS_MAVLink/GCS_MAVLink.h index b59ba9d93c311..7a7db6a68366a 100644 --- a/libraries/GCS_MAVLink/GCS_MAVLink.h +++ b/libraries/GCS_MAVLink/GCS_MAVLink.h @@ -55,10 +55,7 @@ extern mavlink_system_t mavlink_system; /// @param chan Channel to send to static inline bool valid_channel(mavlink_channel_t chan) { -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wtautological-constant-out-of-range-compare" - return chan < MAVLINK_COMM_NUM_BUFFERS; -#pragma clang diagnostic pop + return static_cast(chan) < MAVLINK_COMM_NUM_BUFFERS; } mavlink_message_t* mavlink_get_channel_buffer(uint8_t chan);