diff --git a/controller_interface/CMakeLists.txt b/controller_interface/CMakeLists.txt index 19a501dc62..917da0a8c9 100644 --- a/controller_interface/CMakeLists.txt +++ b/controller_interface/CMakeLists.txt @@ -2,7 +2,8 @@ cmake_minimum_required(VERSION 3.16) project(controller_interface LANGUAGES CXX) if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") - add_compile_options(-Wall -Wextra -Werror=conversion -Werror=unused-but-set-variable -Werror=return-type -Werror=shadow) + add_compile_options(-Wall -Wextra -Werror=conversion -Werror=unused-but-set-variable -Werror=return-type -Werror=shadow + -Werror=missing-braces) endif() set(THIS_PACKAGE_INCLUDE_DEPENDS diff --git a/controller_interface/test/test_force_torque_sensor.hpp b/controller_interface/test/test_force_torque_sensor.hpp index 2d61f665c3..b26517a90c 100644 --- a/controller_interface/test/test_force_torque_sensor.hpp +++ b/controller_interface/test/test_force_torque_sensor.hpp @@ -68,13 +68,13 @@ class ForceTorqueSensorTest : public ::testing::Test protected: const size_t size_ = 6; const std::string sensor_name_ = "test_FTS"; - std::array force_values_ = {1.1, 2.2, 3.3}; - std::array torque_values_ = {4.4, 5.5, 6.6}; + std::array force_values_ = {{1.1, 2.2, 3.3}}; + std::array torque_values_ = {{4.4, 5.5, 6.6}}; std::unique_ptr force_torque_sensor_; std::vector full_interface_names_; - const std::vector fts_interface_names_ = {"force.x", "force.y", "force.z", - "torque.x", "torque.y", "torque.z"}; + const std::vector fts_interface_names_ = { + {"force.x", "force.y", "force.z", "torque.x", "torque.y", "torque.z"}}; }; #endif // TEST_FORCE_TORQUE_SENSOR_HPP_ diff --git a/controller_interface/test/test_imu_sensor.hpp b/controller_interface/test/test_imu_sensor.hpp index 9d0a39e7e5..801a425546 100644 --- a/controller_interface/test/test_imu_sensor.hpp +++ b/controller_interface/test/test_imu_sensor.hpp @@ -56,9 +56,9 @@ class IMUSensorTest : public ::testing::Test protected: const size_t size_ = 10; const std::string sensor_name_ = "test_IMU"; - std::array orientation_values_ = {1.1, 2.2, 3.3, 4.4}; - std::array angular_velocity_values_ = {4.4, 5.5, 6.6}; - std::array linear_acceleration_values_ = {4.4, 5.5, 6.6}; + std::array orientation_values_ = {{1.1, 2.2, 3.3, 4.4}}; + std::array angular_velocity_values_ = {{4.4, 5.5, 6.6}}; + std::array linear_acceleration_values_ = {{4.4, 5.5, 6.6}}; std::unique_ptr imu_sensor_; std::vector full_interface_names_; diff --git a/controller_manager/CMakeLists.txt b/controller_manager/CMakeLists.txt index 376cef3362..1d6c76b5d5 100644 --- a/controller_manager/CMakeLists.txt +++ b/controller_manager/CMakeLists.txt @@ -2,7 +2,8 @@ cmake_minimum_required(VERSION 3.16) project(controller_manager LANGUAGES CXX) if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") - add_compile_options(-Wall -Wextra -Werror=conversion -Werror=unused-but-set-variable -Werror=return-type -Werror=shadow) + add_compile_options(-Wall -Wextra -Werror=conversion -Werror=unused-but-set-variable -Werror=return-type -Werror=shadow + -Werror=missing-braces) endif() set(THIS_PACKAGE_INCLUDE_DEPENDS diff --git a/hardware_interface/CMakeLists.txt b/hardware_interface/CMakeLists.txt index 2613ba735a..94eaa6a050 100644 --- a/hardware_interface/CMakeLists.txt +++ b/hardware_interface/CMakeLists.txt @@ -2,7 +2,8 @@ cmake_minimum_required(VERSION 3.16) project(hardware_interface LANGUAGES CXX) if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") - add_compile_options(-Wall -Wextra -Werror=conversion -Werror=unused-but-set-variable -Werror=return-type -Werror=shadow) + add_compile_options(-Wall -Wextra -Werror=conversion -Werror=unused-but-set-variable -Werror=return-type -Werror=shadow + -Werror=missing-braces) endif() set(THIS_PACKAGE_INCLUDE_DEPENDS diff --git a/hardware_interface/test/test_component_interfaces.cpp b/hardware_interface/test/test_component_interfaces.cpp index d90756c324..6dc1c394b0 100644 --- a/hardware_interface/test/test_component_interfaces.cpp +++ b/hardware_interface/test/test_component_interfaces.cpp @@ -341,12 +341,12 @@ class DummySystem : public hardware_interface::SystemInterface private: std::array position_state_ = { - std::numeric_limits::quiet_NaN(), std::numeric_limits::quiet_NaN(), - std::numeric_limits::quiet_NaN()}; + {std::numeric_limits::quiet_NaN(), std::numeric_limits::quiet_NaN(), + std::numeric_limits::quiet_NaN()}}; std::array velocity_state_ = { - std::numeric_limits::quiet_NaN(), std::numeric_limits::quiet_NaN(), - std::numeric_limits::quiet_NaN()}; - std::array velocity_command_ = {0.0, 0.0, 0.0}; + {std::numeric_limits::quiet_NaN(), std::numeric_limits::quiet_NaN(), + std::numeric_limits::quiet_NaN()}}; + std::array velocity_command_ = {{0.0, 0.0, 0.0}}; // Helper variables to initiate error on read unsigned int read_calls_ = 0; diff --git a/hardware_interface/test/test_hardware_components/test_system_with_command_modes.cpp b/hardware_interface/test/test_hardware_components/test_system_with_command_modes.cpp index a594d3b70a..aba2f86fe5 100644 --- a/hardware_interface/test/test_hardware_components/test_system_with_command_modes.cpp +++ b/hardware_interface/test/test_hardware_components/test_system_with_command_modes.cpp @@ -184,11 +184,11 @@ class TestSystemCommandModes : public hardware_interface::SystemInterface std::vector start_modes_ = {"position", "position"}; std::vector stop_modes_ = {false, false}; - std::array position_command_ = {0.0, 0.0}; - std::array velocity_command_ = {0.0, 0.0}; - std::array position_state_ = {0.0, 0.0}; - std::array velocity_state_ = {0.0, 0.0}; - std::array acceleration_state_ = {0.0, 0.0}; + std::array position_command_ = {{0.0, 0.0}}; + std::array velocity_command_ = {{0.0, 0.0}}; + std::array position_state_ = {{0.0, 0.0}}; + std::array velocity_state_ = {{0.0, 0.0}}; + std::array acceleration_state_ = {{0.0, 0.0}}; }; } // namespace test_hardware_components diff --git a/hardware_interface/test/test_hardware_components/test_two_joint_system.cpp b/hardware_interface/test/test_hardware_components/test_two_joint_system.cpp index b597804104..fe06a64223 100644 --- a/hardware_interface/test/test_hardware_components/test_two_joint_system.cpp +++ b/hardware_interface/test/test_hardware_components/test_two_joint_system.cpp @@ -103,8 +103,8 @@ class TestTwoJointSystem : public SystemInterface } private: - std::array position_command_ = {0.0, 0.0}; - std::array position_state_ = {0.0, 0.0}; + std::array position_command_ = {{0.0, 0.0}}; + std::array position_state_ = {{0.0, 0.0}}; }; } // namespace test_hardware_components diff --git a/hardware_interface_testing/CMakeLists.txt b/hardware_interface_testing/CMakeLists.txt index 8e88a677bf..cd8e30028a 100644 --- a/hardware_interface_testing/CMakeLists.txt +++ b/hardware_interface_testing/CMakeLists.txt @@ -2,7 +2,8 @@ cmake_minimum_required(VERSION 3.16) project(hardware_interface_testing LANGUAGES CXX) if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") - add_compile_options(-Wall -Wextra -Werror=conversion -Werror=unused-but-set-variable -Werror=return-type -Werror=shadow) + add_compile_options(-Wall -Wextra -Werror=conversion -Werror=unused-but-set-variable -Werror=return-type -Werror=shadow + -Werror=missing-braces) endif() set(THIS_PACKAGE_INCLUDE_DEPENDS diff --git a/hardware_interface_testing/test/test_components/test_system.cpp b/hardware_interface_testing/test/test_components/test_system.cpp index bc7a75df6f..6eed347299 100644 --- a/hardware_interface_testing/test/test_components/test_system.cpp +++ b/hardware_interface_testing/test/test_components/test_system.cpp @@ -114,10 +114,10 @@ class TestSystem : public SystemInterface } private: - std::array velocity_command_ = {0.0, 0.0}; - std::array position_state_ = {0.0, 0.0}; - std::array velocity_state_ = {0.0, 0.0}; - std::array acceleration_state_ = {0.0, 0.0}; + std::array velocity_command_ = {{0.0, 0.0}}; + std::array position_state_ = {{0.0, 0.0}}; + std::array velocity_state_ = {{0.0, 0.0}}; + std::array acceleration_state_ = {{0.0, 0.0}}; double max_acceleration_command_ = 0.0; double configuration_state_ = 0.0; double configuration_command_ = 0.0; diff --git a/joint_limits/CMakeLists.txt b/joint_limits/CMakeLists.txt index 1ed74c7603..f0ad3de6fc 100644 --- a/joint_limits/CMakeLists.txt +++ b/joint_limits/CMakeLists.txt @@ -2,7 +2,8 @@ cmake_minimum_required(VERSION 3.16) project(joint_limits LANGUAGES CXX) if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") - add_compile_options(-Wall -Wextra -Werror=conversion -Werror=unused-but-set-variable -Werror=return-type -Werror=shadow) + add_compile_options(-Wall -Wextra -Werror=conversion -Werror=unused-but-set-variable -Werror=return-type -Werror=shadow + -Werror=missing-braces) endif() set(THIS_PACKAGE_INCLUDE_DEPENDS diff --git a/transmission_interface/CMakeLists.txt b/transmission_interface/CMakeLists.txt index efd8db1652..fc55c483d0 100644 --- a/transmission_interface/CMakeLists.txt +++ b/transmission_interface/CMakeLists.txt @@ -2,7 +2,8 @@ cmake_minimum_required(VERSION 3.16) project(transmission_interface LANGUAGES CXX) if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") - add_compile_options(-Wall -Wextra -Werror=conversion -Werror=unused-but-set-variable -Werror=return-type -Werror=shadow) + add_compile_options(-Wall -Wextra -Werror=conversion -Werror=unused-but-set-variable -Werror=return-type -Werror=shadow + -Werror=missing-braces) endif() set(THIS_PACKAGE_INCLUDE_DEPENDS