From fb5cb87e9baa7ae003d4fe99d4e3b173b1e4d5bd Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Sat, 3 Jun 2017 11:52:10 -0400 Subject: [PATCH] enable -Wlogical-op and fix bmi160 --- cmake/common/px4_base.cmake | 2 +- src/drivers/bmi160/bmi160.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/common/px4_base.cmake b/cmake/common/px4_base.cmake index 2fbe2b4cba..778e195d47 100644 --- a/cmake/common/px4_base.cmake +++ b/cmake/common/px4_base.cmake @@ -332,6 +332,7 @@ function(px4_add_common_flags) -Wfloat-equal -Wformat-security -Winit-self + -Wlogical-op -Wmissing-declarations -Wmissing-field-initializers #-Wmissing-include-dirs # TODO: fix and enable @@ -361,7 +362,6 @@ function(px4_add_common_flags) list(APPEND warnings -Wunused-but-set-variable -Wformat=1 - #-Wlogical-op # very verbose due to eigen -Wdouble-promotion ) endif() diff --git a/src/drivers/bmi160/bmi160.cpp b/src/drivers/bmi160/bmi160.cpp index 7cfabd04ba..cd9e9fe7a1 100644 --- a/src/drivers/bmi160/bmi160.cpp +++ b/src/drivers/bmi160/bmi160.cpp @@ -1131,7 +1131,7 @@ BMI160::measure() check_registers(); - if ((!(status && (0x80))) && (!(status && (0x04)))) { + if ((!(status & (0x80))) && (!(status & (0x04)))) { perf_end(_sample_perf); perf_count(_duplicates); _got_duplicate = true;