From b1b51587bcb517f0edefc96e03c4cb362d10d671 Mon Sep 17 00:00:00 2001 From: Christian Rauch Date: Wed, 30 Oct 2024 14:56:54 +0100 Subject: [PATCH] turn all warnings into errors but ignore type punning for franka_hardware --- franka_example_controllers/CMakeLists.txt | 2 +- franka_gripper/CMakeLists.txt | 2 +- franka_hardware/CMakeLists.txt | 2 +- franka_hardware/test/CMakeLists.txt | 4 +++- franka_robot_state_broadcaster/CMakeLists.txt | 2 +- franka_semantic_components/CMakeLists.txt | 2 +- integration_launch_testing/CMakeLists.txt | 2 +- 7 files changed, 9 insertions(+), 7 deletions(-) diff --git a/franka_example_controllers/CMakeLists.txt b/franka_example_controllers/CMakeLists.txt index ea89d8b6..ba0f86c8 100644 --- a/franka_example_controllers/CMakeLists.txt +++ b/franka_example_controllers/CMakeLists.txt @@ -8,7 +8,7 @@ if(NOT CMAKE_CXX_STANDARD) endif() if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_compile_options(-Wall -Wextra -Wpedantic) + add_compile_options(-Werror -Wall -Wextra -Wpedantic) endif() option(CHECK_TIDY "Adds clang-tidy tests" OFF) diff --git a/franka_gripper/CMakeLists.txt b/franka_gripper/CMakeLists.txt index b386361c..aab5ffde 100644 --- a/franka_gripper/CMakeLists.txt +++ b/franka_gripper/CMakeLists.txt @@ -6,7 +6,7 @@ if(NOT CMAKE_CXX_STANDARD) endif() if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_compile_options(-Wall -Wextra -Wpedantic) + add_compile_options(-Werror -Wall -Wextra -Wpedantic) endif() find_package(ament_cmake REQUIRED) diff --git a/franka_hardware/CMakeLists.txt b/franka_hardware/CMakeLists.txt index c8e8f234..c4277e93 100644 --- a/franka_hardware/CMakeLists.txt +++ b/franka_hardware/CMakeLists.txt @@ -7,7 +7,7 @@ if(NOT CMAKE_CXX_STANDARD) endif() if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_compile_options(-Wall -Wextra -Wpedantic) + add_compile_options(-Werror -Wall -Wextra -Wpedantic) endif() option(CHECK_TIDY "Adds clang-tidy tests" OFF) diff --git a/franka_hardware/test/CMakeLists.txt b/franka_hardware/test/CMakeLists.txt index 7a940afc..2cf1ac40 100644 --- a/franka_hardware/test/CMakeLists.txt +++ b/franka_hardware/test/CMakeLists.txt @@ -2,5 +2,7 @@ find_package(ament_cmake_gmock REQUIRED) ament_add_gmock(${PROJECT_NAME}_test franka_hardware_interface_test.cpp) target_include_directories(${PROJECT_NAME}_test PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../include) - target_link_libraries(${PROJECT_NAME}_test ${PROJECT_NAME}) + +# ignore type punning via 'reinterpret_cast(&[...])' +target_compile_options(${PROJECT_NAME}_test PRIVATE -Wno-error=strict-aliasing) diff --git a/franka_robot_state_broadcaster/CMakeLists.txt b/franka_robot_state_broadcaster/CMakeLists.txt index 7f28efc8..f630cfbb 100644 --- a/franka_robot_state_broadcaster/CMakeLists.txt +++ b/franka_robot_state_broadcaster/CMakeLists.txt @@ -7,7 +7,7 @@ if(NOT CMAKE_CXX_STANDARD) endif() if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_compile_options(-Wall -Wextra -Wpedantic) + add_compile_options(-Werror -Wall -Wextra -Wpedantic) endif() option(CHECK_TIDY "Adds clang-tidy tests" OFF) diff --git a/franka_semantic_components/CMakeLists.txt b/franka_semantic_components/CMakeLists.txt index 3c72bc85..c56f2b00 100644 --- a/franka_semantic_components/CMakeLists.txt +++ b/franka_semantic_components/CMakeLists.txt @@ -7,7 +7,7 @@ if(NOT CMAKE_CXX_STANDARD) endif() if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_compile_options(-Wall -Wextra -Wpedantic) + add_compile_options(-Werror -Wall -Wextra -Wpedantic) endif() option(CHECK_TIDY "Adds clang-tidy tests" OFF) diff --git a/integration_launch_testing/CMakeLists.txt b/integration_launch_testing/CMakeLists.txt index 49c5771d..927e8354 100644 --- a/integration_launch_testing/CMakeLists.txt +++ b/integration_launch_testing/CMakeLists.txt @@ -8,7 +8,7 @@ if(NOT CMAKE_CXX_STANDARD) endif() if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_compile_options(-Wall -Wextra -Wpedantic) + add_compile_options(-Werror -Wall -Wextra -Wpedantic) endif() # find dependencies