From b24d850695b6e044a1af4f6bf9c0a946c7198c39 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Thu, 29 Sep 2016 08:49:47 -0300 Subject: [PATCH] ArduCopter: Fix use of logical op instead of bitwise op ../../ArduCopter/GCS_Mavlink.cpp: In member function 'void Copter::send_extended_status1(mavlink_channel_t)': ../../ArduCopter/GCS_Mavlink.cpp:281:37: error: suggest parentheses around operand of '!' or change '&' to '&&' or '!' to '~' [-Werror=parentheses] uint32_t sensors_error_flags = !control_sensors_health & control_sensors_enabled & control_sensors_present; ^ compilation terminated due to -Wfatal-errors. cc1plus: all warnings being treated as errors Thanks to Ralph Campbell for the bug report. --- ArduCopter/GCS_Mavlink.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArduCopter/GCS_Mavlink.cpp b/ArduCopter/GCS_Mavlink.cpp index 853a463c91..32602be04a 100644 --- a/ArduCopter/GCS_Mavlink.cpp +++ b/ArduCopter/GCS_Mavlink.cpp @@ -278,7 +278,7 @@ NOINLINE void Copter::send_extended_status1(mavlink_channel_t chan) #if FRSKY_TELEM_ENABLED == ENABLED // give mask of error flags to Frsky_Telemetry - uint32_t sensors_error_flags = !control_sensors_health & control_sensors_enabled & control_sensors_present; + uint32_t sensors_error_flags = (~control_sensors_health) & control_sensors_enabled & control_sensors_present; frsky_telemetry.update_sensor_status_flags(sensors_error_flags); #endif