From 0b79be4a3d24b54477728e900f399be9d1726370 Mon Sep 17 00:00:00 2001 From: AnaghaRaoAMD Date: Fri, 29 May 2026 23:48:28 +0000 Subject: [PATCH] Fix -Werror=unused-variable errors breaking superbuild Replace `auto _ = expr()` with `(void)expr()` to properly discard return values without triggering unused variable warnings under -Werror. Co-Authored-By: Claude Opus 4.6 --- projects/hipdnn/backend/src/HipdnnBackend.cpp | 4 ++-- .../include/hipdnn_data_sdk/utilities/PlatformUtils.linux.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/hipdnn/backend/src/HipdnnBackend.cpp b/projects/hipdnn/backend/src/HipdnnBackend.cpp index 9d9b3dab09ec..3132c99e4197 100644 --- a/projects/hipdnn/backend/src/HipdnnBackend.cpp +++ b/projects/hipdnn/backend/src/HipdnnBackend.cpp @@ -408,7 +408,7 @@ HIPDNN_BACKEND_EXPORT void hipdnnGetLastErrorString(char* message, size_t maxSiz LOG_API_ENTRY("message_ptr={:p}, maxSize={}", static_cast(message), maxSize); // Ignore status since API doesn't return it. // We still want to catch and log if the user provides incorrect parameters. - auto _ = hipdnn_backend::tryCatch([&, apiName = __func__] { + (void)hipdnn_backend::tryCatch([&, apiName = __func__] { throwIfNull(message); if(maxSize == 0) @@ -431,7 +431,7 @@ HIPDNN_BACKEND_EXPORT void hipdnnPeekLastErrorString_ext(char* message, size_t m LOG_API_ENTRY("message_ptr={:p}, maxSize={}", static_cast(message), maxSize); // Ignore status since API doesn't return it. // We still want to catch and log if the user provides incorrect parameters. - auto _ = hipdnn_backend::tryCatch([&, apiName = __func__] { + (void)hipdnn_backend::tryCatch([&, apiName = __func__] { throwIfNull(message); if(maxSize == 0) diff --git a/projects/hipdnn/data_sdk/include/hipdnn_data_sdk/utilities/PlatformUtils.linux.hpp b/projects/hipdnn/data_sdk/include/hipdnn_data_sdk/utilities/PlatformUtils.linux.hpp index be08fb995e7c..63f5d6c8be48 100644 --- a/projects/hipdnn/data_sdk/include/hipdnn_data_sdk/utilities/PlatformUtils.linux.hpp +++ b/projects/hipdnn/data_sdk/include/hipdnn_data_sdk/utilities/PlatformUtils.linux.hpp @@ -89,13 +89,13 @@ inline void closeLibrary(SharedLibraryHandle handle) inline void* getSymbol(SharedLibraryHandle handle, const char* symbolName) { - auto _ = dlerror(); + (void)dlerror(); return dlsym(handle, symbolName); } inline std::filesystem::path getLoadedLibraryDirectoryForSymbol(const char* symbolName) { - auto _ = dlerror(); + (void)dlerror(); void* symbol = dlsym(RTLD_DEFAULT, symbolName); const char* error = dlerror(); if(error != nullptr)