From 7200472902af0b69f57a57e29cfddd4fedfe05cd Mon Sep 17 00:00:00 2001 From: Tomoya Fujita Date: Wed, 2 Sep 2026 16:35:11 +0900 Subject: [PATCH] address compiler warning from ignored rmw_publish and rmw_take_event. Signed-off-by: Tomoya Fujita --- .../test/test_event_message_lost_deadlock.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test_rmw_implementation/test/test_event_message_lost_deadlock.cpp b/test_rmw_implementation/test/test_event_message_lost_deadlock.cpp index e48ad901..aad0f395 100644 --- a/test_rmw_implementation/test/test_event_message_lost_deadlock.cpp +++ b/test_rmw_implementation/test/test_event_message_lost_deadlock.cpp @@ -53,6 +53,7 @@ #include #include #include +#include #include "rcutils/allocator.h" #include "rcutils/strdup.h" @@ -145,7 +146,8 @@ TEST_F(TestEventMessageLostDeadlock, take_event_does_not_deadlock_with_on_sample test_msgs__msg__BasicTypes msg; test_msgs__msg__BasicTypes__init(&msg); while (!stop.load(std::memory_order_relaxed)) { - (void)rmw_publish(pub, &msg, nullptr); + // Failures are irrelevant here; the flood must keep running. + std::ignore = rmw_publish(pub, &msg, nullptr); } test_msgs__msg__BasicTypes__fini(&msg); }); @@ -156,7 +158,8 @@ TEST_F(TestEventMessageLostDeadlock, take_event_does_not_deadlock_with_on_sample rmw_message_lost_status_t status; bool taken = false; while (!stop.load(std::memory_order_relaxed)) { - (void)rmw_take_event(&event, &status, &taken); + // Failures are irrelevant here; the loop must keep taking. + std::ignore = rmw_take_event(&event, &status, &taken); take_iters.fetch_add(1, std::memory_order_relaxed); } });