From 378db51de99e200fd26e743e004fa03b7fe3cd17 Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Thu, 24 Oct 2024 03:50:03 +0300 Subject: [PATCH] Get rid of simulator build warnings --- gazebo/Arduino.h | 2 +- gazebo/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/gazebo/Arduino.h b/gazebo/Arduino.h index 7ea6f90..48b56de 100644 --- a/gazebo/Arduino.h +++ b/gazebo/Arduino.h @@ -117,7 +117,7 @@ class HardwareSerial: public Print { int read() { if (available()) { char c; - ::read(STDIN_FILENO, &c, 1); // use raw read to avoid C++ buffering + size_t res = ::read(STDIN_FILENO, &c, 1); // use raw read to avoid C++ buffering // https://stackoverflow.com/questions/45238997/does-getchar-function-has-its-own-buffer-to-store-remaining-input return c; } diff --git a/gazebo/CMakeLists.txt b/gazebo/CMakeLists.txt index 5bb0eb3..2fbab01 100644 --- a/gazebo/CMakeLists.txt +++ b/gazebo/CMakeLists.txt @@ -15,6 +15,7 @@ set(CMAKE_BUILD_TYPE RelWithDebInfo) add_library(flix SHARED simulator.cpp) target_link_libraries(flix ${GAZEBO_LIBRARIES} ${SDL2_LIBRARIES}) target_include_directories(flix PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) +target_compile_options(flix PRIVATE -Wno-address-of-packed-member) # disable unneeded mavlink warnings # Include dir for MAVLink-Arduino library target_include_directories(flix PUBLIC $ENV{HOME}/Arduino/libraries/MAVLink)