From c4813b504d3beac08b2ea733553f77f8dc0f7c28 Mon Sep 17 00:00:00 2001 From: "LIU, CHAUNCY" Date: Thu, 22 Feb 2024 01:27:24 -0500 Subject: [PATCH] Fix string-format type mismatches & add https://github.com/ros2/rclc --- rclc/CMakeLists.txt | 2 +- rclc/src/rclc/executor.c | 14 +++++++------- rclc/src/rclc/timer.c | 2 +- rclc_examples/CMakeLists.txt | 2 +- rclc_lifecycle/CMakeLists.txt | 2 +- rclc_parameter/CMakeLists.txt | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/rclc/CMakeLists.txt b/rclc/CMakeLists.txt index 32703d18..c7166240 100644 --- a/rclc/CMakeLists.txt +++ b/rclc/CMakeLists.txt @@ -19,7 +19,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(-Wall -Wextra) endif() set(CMAKE_VERBOSE_MAKEFILE ON) diff --git a/rclc/src/rclc/executor.c b/rclc/src/rclc/executor.c index b91aa783..bbd51642 100644 --- a/rclc/src/rclc/executor.c +++ b/rclc/src/rclc/executor.c @@ -1833,7 +1833,7 @@ rclc_executor_spin_some(rclc_executor_t * executor, const uint64_t timeout_ns) if (rc == RCL_RET_OK) { RCUTILS_LOG_DEBUG_NAMED( ROS_PACKAGE_NAME, - "Subscription added to wait_set_subscription[%ld]", + "Subscription added to wait_set_subscription[%d]", executor->handles[i].index); } else { PRINT_RCLC_ERROR(rclc_executor_spin_some, rcl_wait_set_add_subscription); @@ -1849,7 +1849,7 @@ rclc_executor_spin_some(rclc_executor_t * executor, const uint64_t timeout_ns) &executor->handles[i].index); if (rc == RCL_RET_OK) { RCUTILS_LOG_DEBUG_NAMED( - ROS_PACKAGE_NAME, "Timer added to wait_set_timers[%ld]", + ROS_PACKAGE_NAME, "Timer added to wait_set_timers[%d]", executor->handles[i].index); } else { PRINT_RCLC_ERROR(rclc_executor_spin_some, rcl_wait_set_add_timer); @@ -1866,7 +1866,7 @@ rclc_executor_spin_some(rclc_executor_t * executor, const uint64_t timeout_ns) &executor->handles[i].index); if (rc == RCL_RET_OK) { RCUTILS_LOG_DEBUG_NAMED( - ROS_PACKAGE_NAME, "Service added to wait_set_service[%ld]", + ROS_PACKAGE_NAME, "Service added to wait_set_service[%d]", executor->handles[i].index); } else { PRINT_RCLC_ERROR(rclc_executor_spin_some, rcl_wait_set_add_service); @@ -1884,7 +1884,7 @@ rclc_executor_spin_some(rclc_executor_t * executor, const uint64_t timeout_ns) &executor->handles[i].index); if (rc == RCL_RET_OK) { RCUTILS_LOG_DEBUG_NAMED( - ROS_PACKAGE_NAME, "Client added to wait_set_client[%ld]", + ROS_PACKAGE_NAME, "Client added to wait_set_client[%d]", executor->handles[i].index); } else { PRINT_RCLC_ERROR(rclc_executor_spin_some, rcl_wait_set_add_client); @@ -1900,7 +1900,7 @@ rclc_executor_spin_some(rclc_executor_t * executor, const uint64_t timeout_ns) &executor->handles[i].index); if (rc == RCL_RET_OK) { RCUTILS_LOG_DEBUG_NAMED( - ROS_PACKAGE_NAME, "Guard_condition added to wait_set_client[%ld]", + ROS_PACKAGE_NAME, "Guard_condition added to wait_set_client[%d]", executor->handles[i].index); } else { PRINT_RCLC_ERROR(rclc_executor_spin_some, rcl_wait_set_add_guard_condition); @@ -1932,7 +1932,7 @@ rclc_executor_spin_some(rclc_executor_t * executor, const uint64_t timeout_ns) if (rc == RCL_RET_OK) { RCUTILS_LOG_DEBUG_NAMED( ROS_PACKAGE_NAME, - "Action server added to wait_set_action_servers[%ld]", + "Action server added to wait_set_action_servers[%d]", executor->handles[i].index); } else { PRINT_RCLC_ERROR(rclc_executor_spin_some, rcl_wait_set_add_action_server); @@ -1977,7 +1977,7 @@ rclc_executor_spin(rclc_executor_t * executor) rcl_ret_t ret = RCL_RET_OK; RCUTILS_LOG_DEBUG_NAMED( ROS_PACKAGE_NAME, - "INFO: rcl_wait timeout %ld ms", + "INFO: rcl_wait timeout %lld ms", ((executor->timeout_ns / 1000) / 1000)); while (true) { ret = rclc_executor_spin_some(executor, executor->timeout_ns); diff --git a/rclc/src/rclc/timer.c b/rclc/src/rclc/timer.c index f480f9e6..85591172 100644 --- a/rclc/src/rclc/timer.c +++ b/rclc/src/rclc/timer.c @@ -42,7 +42,7 @@ rclc_timer_init_default( if (rc != RCL_RET_OK) { PRINT_RCLC_ERROR(rclc_timer_init_default, rcl_timer_init); } else { - RCUTILS_LOG_INFO("Created a timer with period %ld ms.\n", timeout_ns / 1000000); + RCUTILS_LOG_INFO("Created a timer with period %lld ms.\n", timeout_ns / 1000000); } return rc; } diff --git a/rclc_examples/CMakeLists.txt b/rclc_examples/CMakeLists.txt index c45fc9bd..8549558b 100644 --- a/rclc_examples/CMakeLists.txt +++ b/rclc_examples/CMakeLists.txt @@ -12,7 +12,7 @@ if(NOT CMAKE_C_STANDARD) endif() if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_compile_options(-Wall -Wextra -Wpedantic) + add_compile_options(-Wall -Wextra) endif() set(CMAKE_VERBOSE_MAKEFILE ON) diff --git a/rclc_lifecycle/CMakeLists.txt b/rclc_lifecycle/CMakeLists.txt index e759b747..b580579c 100644 --- a/rclc_lifecycle/CMakeLists.txt +++ b/rclc_lifecycle/CMakeLists.txt @@ -26,7 +26,7 @@ if("${rcl_lifecycle_VERSION}" VERSION_LESS "1.0.0") else() message(STATUS "Found rcl_lifecycle version ${rcl_lifecycle_VERSION}, which belongs to Foxy or later") if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_compile_options(-Wall -Wextra -Wpedantic) + add_compile_options(-Wall -Wextra) endif() endif() diff --git a/rclc_parameter/CMakeLists.txt b/rclc_parameter/CMakeLists.txt index ed584029..a507f876 100644 --- a/rclc_parameter/CMakeLists.txt +++ b/rclc_parameter/CMakeLists.txt @@ -22,7 +22,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(-Wall -Wextra) endif() set(CMAKE_VERBOSE_MAKEFILE ON)