From 5ec546f735c67050257fb7f3c358820d56ded6fe Mon Sep 17 00:00:00 2001 From: Daniel Agar Date: Sun, 1 Jan 2017 22:42:01 -0500 Subject: [PATCH] Makefile add scan-build target --- Makefile | 6 ++++++ src/modules/commander/accelerometer_calibration.cpp | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index abe9c8f342..8dc03b27de 100755 --- a/Makefile +++ b/Makefile @@ -295,6 +295,12 @@ tests_coverage: test_startup_shutdown: @$(call PX4_RUN,$(MAKE) --no-print-directory posix_sitl_test gazebo_standard_vtol HEADLESS=1 MEMORY_DEBUG=1) +scan-build: + export CCACHE_DISABLE=1 + mkdir -p $(SRC_DIR)/build_posix_sitl_default_scan-build + cd $(SRC_DIR)/build_posix_sitl_default_scan-build && scan-build cmake .. -GNinja -DCONFIG=posix_sitl_default + scan-build cmake --build $(SRC_DIR)/build_posix_sitl_default_scan-build + package_firmware: @zip --junk-paths Firmware.zip `find Binaries/. -name \*.px4` diff --git a/src/modules/commander/accelerometer_calibration.cpp b/src/modules/commander/accelerometer_calibration.cpp index ae9925eff6..d6e79e2462 100644 --- a/src/modules/commander/accelerometer_calibration.cpp +++ b/src/modules/commander/accelerometer_calibration.cpp @@ -242,7 +242,7 @@ int do_accel_calibration(orb_advert_t *mavlink_log_pub) float accel_offs[max_accel_sens][3]; float accel_T[max_accel_sens][3][3]; - unsigned active_sensors; + unsigned active_sensors = 0; /* measure and calculate offsets & scales */ if (res == PX4_OK) {