From 32c6b1def63f2948b3d56bb624dece309a7e8af5 Mon Sep 17 00:00:00 2001 From: "Hans J. Johnson" Date: Fri, 13 Mar 2026 13:43:52 -0500 Subject: [PATCH] COMP: Silence nodiscard warnings for Future.get() in PoolMultiThreader Cast Future.get() return values to void where the call is only used for its side effect of waiting for thread completion and propagating exceptions. Fixes the following warnings: ``` ITK/Modules/Core/Common/src/itkPoolMultiThreader.cxx:148:55: warning: ignoring return value of function declared with 'nodiscard' attribute [-Wunused-result] ITK/Modules/Core/Common/src/itkPoolMultiThreader.cxx:303:11: warning: ignoring return value of function declared with 'nodiscard' attribute [-Wunused-result] This is for clang-22 compilers. ``` Co-Authored-By: Claude Opus 4.6 --- Modules/Core/Common/src/itkPoolMultiThreader.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/Core/Common/src/itkPoolMultiThreader.cxx b/Modules/Core/Common/src/itkPoolMultiThreader.cxx index ae4df4c031f..827e175d7b3 100644 --- a/Modules/Core/Common/src/itkPoolMultiThreader.cxx +++ b/Modules/Core/Common/src/itkPoolMultiThreader.cxx @@ -145,7 +145,7 @@ PoolMultiThreader::SingleMethodExecute() // so now it waits for each of the other work units to finish for (threadLoop = 1; threadLoop < m_NumberOfWorkUnits; ++threadLoop) { - exceptionHandler.TryAndCatch([this, threadLoop] { m_ThreadInfoArray[threadLoop].Future.get(); }); + exceptionHandler.TryAndCatch([this, threadLoop] { (void)m_ThreadInfoArray[threadLoop].Future.get(); }); } exceptionHandler.RethrowFirstCaughtException(); @@ -300,7 +300,7 @@ PoolMultiThreader::ParallelizeImageRegion(unsigned int dimension, filter->IncrementProgress(0); } } while (status != std::future_status::ready); - m_ThreadInfoArray[i].Future.get(); + (void)m_ThreadInfoArray[i].Future.get(); reporter.CompletedPixel(); }); }